mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 08:27:43 +01:00
Config to remove curse of binding with weakness
This commit is contained in:
@@ -1,39 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Encode42 <me@encode42.dev>
|
||||
Date: Sun, 8 Aug 2021 16:59:21 -0400
|
||||
Subject: [PATCH] Config to remove curse of binding with weakness
|
||||
|
||||
|
||||
diff --git a/net/minecraft/world/inventory/ArmorSlot.java b/net/minecraft/world/inventory/ArmorSlot.java
|
||||
index db7caaa2e77b9b98adac8add3040131c673c036b..262d9b2507d37edf0ed9c0821059e518d1baa9e9 100644
|
||||
--- a/net/minecraft/world/inventory/ArmorSlot.java
|
||||
+++ b/net/minecraft/world/inventory/ArmorSlot.java
|
||||
@@ -44,7 +44,7 @@ class ArmorSlot extends Slot {
|
||||
@Override
|
||||
public boolean mayPickup(Player playerEntity) {
|
||||
ItemStack itemStack = this.getItem();
|
||||
- return (itemStack.isEmpty() || playerEntity.isCreative() || !EnchantmentHelper.has(itemStack, EnchantmentEffectComponents.PREVENT_ARMOR_CHANGE))
|
||||
+ return (itemStack.isEmpty() || playerEntity.isCreative() || (!EnchantmentHelper.has(itemStack, EnchantmentEffectComponents.PREVENT_ARMOR_CHANGE) || playerEntity.level().purpurConfig.playerRemoveBindingWithWeakness && playerEntity.hasEffect(net.minecraft.world.effect.MobEffects.WEAKNESS)))
|
||||
&& super.mayPickup(playerEntity);
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
index 84c01175dd4d65b1cb8b185f03d93a4cea0e0656..8f90dbc4395381f712befbbf09b6ae94887843e7 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
@@ -399,6 +399,7 @@ public class PurpurWorldConfig {
|
||||
public int playerBurpDelay = 10;
|
||||
public boolean playerBurpWhenFull = false;
|
||||
public boolean playerRidableInWater = false;
|
||||
+ public boolean playerRemoveBindingWithWeakness = false;
|
||||
private void playerSettings() {
|
||||
if (PurpurConfig.version < 19) {
|
||||
boolean oldVal = getBoolean("gameplay-mechanics.player.idle-timeout.mods-target", idleTimeoutTargetPlayer);
|
||||
@@ -422,6 +423,7 @@ public class PurpurWorldConfig {
|
||||
playerBurpDelay = getInt("gameplay-mechanics.player.burp-delay", playerBurpDelay);
|
||||
playerBurpWhenFull = getBoolean("gameplay-mechanics.player.burp-when-full", playerBurpWhenFull);
|
||||
playerRidableInWater = getBoolean("gameplay-mechanics.player.ridable-in-water", playerRidableInWater);
|
||||
+ playerRemoveBindingWithWeakness = getBoolean("gameplay-mechanics.player.curse-of-binding.remove-with-weakness", playerRemoveBindingWithWeakness);
|
||||
}
|
||||
|
||||
public boolean silkTouchEnabled = false;
|
||||
Reference in New Issue
Block a user