diff --git a/patches/server/0773-ItemStack-damage-API.patch b/patches/server/0773-ItemStack-damage-API.patch index 965c0e9084..2f71087902 100644 --- a/patches/server/0773-ItemStack-damage-API.patch +++ b/patches/server/0773-ItemStack-damage-API.patch @@ -11,10 +11,10 @@ the logic associated with damaging them public net.minecraft.world.entity.LivingEntity entityEventForEquipmentBreak(Lnet/minecraft/world/entity/EquipmentSlot;)B diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java -index 598507684aed7978fa2e9bae0d959c7d0f9e53d6..7c52ae813bfe47983ca94f4daf68f17e899949da 100644 +index 598507684aed7978fa2e9bae0d959c7d0f9e53d6..e6588a7fc03df4036b38f9a2011e7a716ff111f4 100644 --- a/src/main/java/net/minecraft/world/item/ItemStack.java +++ b/src/main/java/net/minecraft/world/item/ItemStack.java -@@ -647,11 +647,16 @@ public final class ItemStack implements DataComponentHolder { +@@ -647,8 +647,13 @@ public final class ItemStack implements DataComponentHolder { } public void hurtAndBreak(int amount, ServerLevel world, @Nullable LivingEntity player, Consumer breakCallback) { // Paper - Add EntityDamageItemEvent @@ -28,11 +28,7 @@ index 598507684aed7978fa2e9bae0d959c7d0f9e53d6..7c52ae813bfe47983ca94f4daf68f17e + if (player == null || !player.hasInfiniteMaterials() || force) { // Paper if (amount > 0) { int originalDamage = amount; // Paper - Expand PlayerItemDamageEvent -- amount = EnchantmentHelper.processDurabilityChange(world, this, amount); -+ if (!force) amount = EnchantmentHelper.processDurabilityChange(world, this, amount); // Paper - itemstack damage API - do not consider enchantments when damaging from API - // CraftBukkit start - if (player instanceof ServerPlayer serverPlayer) { // Paper - Add EntityDamageItemEvent - PlayerItemDamageEvent event = new PlayerItemDamageEvent(serverPlayer.getBukkitEntity(), CraftItemStack.asCraftMirror(this), amount, originalDamage); // Paper - Add EntityDamageItemEvent & Expand PlayerItemDamageEvent + amount = EnchantmentHelper.processDurabilityChange(world, this, amount); @@ -699,6 +704,11 @@ public final class ItemStack implements DataComponentHolder { }