Config to remove curse of binding with weakness

This commit is contained in:
Encode42
2025-01-12 12:11:13 -08:00
committed by granny
parent ce87a62878
commit 8bff021a40
3 changed files with 13 additions and 39 deletions

View File

@@ -0,0 +1,11 @@
--- a/net/minecraft/world/inventory/ArmorSlot.java
+++ b/net/minecraft/world/inventory/ArmorSlot.java
@@ -42,7 +_,7 @@
@Override
public boolean mayPickup(Player player) {
ItemStack item = this.getItem();
- return (item.isEmpty() || player.isCreative() || !EnchantmentHelper.has(item, EnchantmentEffectComponents.PREVENT_ARMOR_CHANGE))
+ return (item.isEmpty() || player.isCreative() || (!EnchantmentHelper.has(item, EnchantmentEffectComponents.PREVENT_ARMOR_CHANGE) || player.level().purpurConfig.playerRemoveBindingWithWeakness && player.hasEffect(net.minecraft.world.effect.MobEffects.WEAKNESS))) // Purpur - Config to remove curse of binding with weakness
&& super.mayPickup(player);
}

View File

@@ -398,6 +398,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);
@@ -421,6 +422,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;