diff options
author | Bjarne Koll <[email protected]> | 2024-12-14 21:45:55 +0100 |
---|---|---|
committer | Bjarne Koll <[email protected]> | 2024-12-14 21:45:55 +0100 |
commit | 836cb490181c05834728549bebc83192cbb3b896 (patch) | |
tree | 53a9cded50c08cb84abaf0fec24a996fbca54353 | |
parent | b746d9df0b6b7765478b2a72c2d963b6e668fa35 (diff) | |
download | Paper-bugfix/entity-item-damage-event.tar.gz Paper-bugfix/entity-item-damage-event.zip |
Pass correct damage to EntityDamageItemEventbugfix/entity-item-damage-event
-rw-r--r-- | patches/server/0566-Add-EntityDamageItemEvent.patch | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/patches/server/0566-Add-EntityDamageItemEvent.patch b/patches/server/0566-Add-EntityDamageItemEvent.patch index bfe6c8751a..8b72039a5b 100644 --- a/patches/server/0566-Add-EntityDamageItemEvent.patch +++ b/patches/server/0566-Add-EntityDamageItemEvent.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add EntityDamageItemEvent diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java -index 225206a055e2f6bf4dbb18434cb3401d02746387..e320264c2283c2c09910ea70606413c73f443b1f 100644 +index 225206a055e2f6bf4dbb18434cb3401d02746387..45bed9ff8f16d16317b2300f4854017d1d1dec70 100644 --- a/src/main/java/net/minecraft/world/item/ItemStack.java +++ b/src/main/java/net/minecraft/world/item/ItemStack.java @@ -697,11 +697,11 @@ public final class ItemStack implements DataComponentHolder { @@ -29,7 +29,7 @@ index 225206a055e2f6bf4dbb18434cb3401d02746387..e320264c2283c2c09910ea70606413c7 j = event.getDamage(); + // Paper start - Add EntityDamageItemEvent + } else if (player != null) { -+ io.papermc.paper.event.entity.EntityDamageItemEvent event = new io.papermc.paper.event.entity.EntityDamageItemEvent(player.getBukkitLivingEntity(), CraftItemStack.asCraftMirror(this), amount); ++ io.papermc.paper.event.entity.EntityDamageItemEvent event = new io.papermc.paper.event.entity.EntityDamageItemEvent(player.getBukkitLivingEntity(), CraftItemStack.asCraftMirror(this), j); + if (!event.callEvent()) { + return; + } |