13
0
geforkt von Mirrors/Paper

SPIGOT-7904: Fix NPE for PlayerItemBreakEvent

By: Doc <nachito94@msn.com>
Dieser Commit ist enthalten in:
CraftBukkit/Spigot 2024-09-19 06:45:18 +10:00
Ursprung c33c116001
Commit c98b18d4a2

Datei anzeigen

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