aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0574-Add-EntityDamageItemEvent.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/server/0574-Add-EntityDamageItemEvent.patch')
-rw-r--r--patches/server/0574-Add-EntityDamageItemEvent.patch6
1 files changed, 3 insertions, 3 deletions
diff --git a/patches/server/0574-Add-EntityDamageItemEvent.patch b/patches/server/0574-Add-EntityDamageItemEvent.patch
index 1adcd93580..fc8649b86d 100644
--- a/patches/server/0574-Add-EntityDamageItemEvent.patch
+++ b/patches/server/0574-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 7497471649bec04ab8b43dec06b31edd892a5cfb..ad1cb11245108b5cb187b686ed7e6bc769193b52 100644
+index d1eac70fbfe2d863d3a342ed0e83223c65c36c03..a98d76c90cd855e723e7a8d810eee88a882d8b5c 100644
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
@@ -646,14 +646,14 @@ public final class ItemStack implements DataComponentHolder {
@@ -56,9 +56,9 @@ index 7497471649bec04ab8b43dec06b31edd892a5cfb..ad1cb11245108b5cb187b686ed7e6bc7
if (j >= this.getMaxDamage()) {
Item item = this.getItem();
// CraftBukkit start - Check for item breaking
-- if (this.count == 1) {
+- if (this.count == 1 && player != null) {
- org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerItemBreakEvent(player, this);
-+ if (this.count == 1 && player instanceof final ServerPlayer serverPlayer) { // Paper - Add EntityDamageItemEvent
++ if (this.count == 1 && player != null && player instanceof final ServerPlayer serverPlayer) { // Paper - Add EntityDamageItemEvent
+ org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerItemBreakEvent(serverPlayer, this); // Paper - Add EntityDamageItemEvent
}
// CraftBukkit end