mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-18 12:48:53 +01:00
Pass correct damage to EntityDamageItemEvent (#11744)
This commit is contained in:
parent
b746d9df0b
commit
bb76819589
1 changed files with 2 additions and 2 deletions
|
@ -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
|
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
|
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||||
+++ b/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 {
|
@@ -697,11 +697,11 @@ public final class ItemStack implements DataComponentHolder {
|
||||||
|
@ -29,7 +29,7 @@ index 225206a055e2f6bf4dbb18434cb3401d02746387..e320264c2283c2c09910ea70606413c7
|
||||||
j = event.getDamage();
|
j = event.getDamage();
|
||||||
+ // Paper start - Add EntityDamageItemEvent
|
+ // Paper start - Add EntityDamageItemEvent
|
||||||
+ } else if (player != null) {
|
+ } 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()) {
|
+ if (!event.callEvent()) {
|
||||||
+ return;
|
+ return;
|
||||||
+ }
|
+ }
|
||||||
|
|
Loading…
Reference in a new issue