aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0788-ItemStack-damage-API.patch
diff options
context:
space:
mode:
authorBjarne Koll <[email protected]>2024-05-31 17:55:26 +0200
committerBjarne Koll <[email protected]>2024-05-31 17:55:26 +0200
commit9e73add71636ea066bad2d39e8739f0d41508dd9 (patch)
tree5999acd21d54aef1a9b957c22df511a8c1ad0612 /patches/server/0788-ItemStack-damage-API.patch
parent5485fbab8e07e612a4cb01cb7e79866771faa0d0 (diff)
downloadPaper-bugfix/itemstack-damage-api.tar.gz
Paper-bugfix/itemstack-damage-api.zip
Diffstat (limited to 'patches/server/0788-ItemStack-damage-API.patch')
-rw-r--r--patches/server/0788-ItemStack-damage-API.patch7
1 files changed, 4 insertions, 3 deletions
diff --git a/patches/server/0788-ItemStack-damage-API.patch b/patches/server/0788-ItemStack-damage-API.patch
index 22cb6ab1d8..ba4a14ae11 100644
--- a/patches/server/0788-ItemStack-damage-API.patch
+++ b/patches/server/0788-ItemStack-damage-API.patch
@@ -11,14 +11,15 @@ 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 acce1b72185d4687ef5a72dd4014d87149f4b092..ee0e08be375234e003675b19c5b77b9249f5c355 100644
+index acce1b72185d4687ef5a72dd4014d87149f4b092..dc473b46394b41d951b68ed0eb6993e6807a0d29 100644
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
-@@ -713,7 +713,13 @@ public final class ItemStack implements DataComponentHolder {
+@@ -713,7 +713,14 @@ public final class ItemStack implements DataComponentHolder {
return;
}
}
+ // Paper start - ItemStack damage API - split hurtAndBreak to skip pre-checks like creative mode
++ this.hurtAndBreakWithoutChecks(amount, entity, slot);
+ }
+ }
@@ -28,7 +29,7 @@ index acce1b72185d4687ef5a72dd4014d87149f4b092..ee0e08be375234e003675b19c5b77b92
RandomSource randomsource = entity.getRandom();
ServerPlayer entityplayer;
-@@ -726,7 +732,7 @@ public final class ItemStack implements DataComponentHolder {
+@@ -726,7 +733,7 @@ public final class ItemStack implements DataComponentHolder {
}
this.hurtAndBreak(amount, randomsource, entity, () -> { // Paper - Add EntityDamageItemEvent