Files
Purpur/patches/server/0196-Config-to-remove-curse-of-binding-with-weakness.patch
granny ffeb49da1e ignore item_model component for don't run with scissors feature alongside custom_model_data component
by default, the "don't run with scissors" feature will not activate for shears that have an `item_model` component or `custom_model_data` component.

adds a new world config option at `gameplay-mechanics.item.shears.damage-if-sprinting-item-model` that allows specifying a custom item model ResourceLocation (`purpurmc:scissors` by default) for use with this feature.
2024-12-06 06:05:14 -08:00

40 lines
2.6 KiB
Diff

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/src/main/java/net/minecraft/world/inventory/ArmorSlot.java b/src/main/java/net/minecraft/world/inventory/ArmorSlot.java
index db7caaa2e77b9b98adac8add3040131c673c036b..262d9b2507d37edf0ed9c0821059e518d1baa9e9 100644
--- a/src/main/java/net/minecraft/world/inventory/ArmorSlot.java
+++ b/src/main/java/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 72d2f15839d04b588e8f43d6a1f06680e7b3d9ee..bb8f71030a2da27cc66820a032ffacf667c0d42b 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;