SPIGOT-7904: Fix NPE for PlayerItemBreakEvent

By: Doc <nachito94@msn.com>
This commit is contained in:
CraftBukkit/Spigot 2024-09-19 06:45:18 +10:00
parent c33c116001
commit c98b18d4a2

View file

@ -307,7 +307,7 @@
if (j >= this.getMaxDamage()) {
Item item = this.getItem();
+ // CraftBukkit start - Check for item breaking
+ if (this.count == 1) {
+ if (this.count == 1 && entityplayer != null) {
+ org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerItemBreakEvent(entityplayer, this);
+ }
+ // CraftBukkit end