Commits

Doc authored and md_5 committed 98c57cbbee3
SPIGOT-7904: Fix NPE for PlayerItemBreakEvent
No tags

nms-patches/net/minecraft/world/item/ItemStack.patch

Modified
300 300 + }
301 301 + // CraftBukkit end
302 302 if (i <= 0) {
303 303 return;
304 304 }
305 305 @@ -458,6 +672,11 @@
306 306 this.setDamageValue(j);
307 307 if (j >= this.getMaxDamage()) {
308 308 Item item = this.getItem();
309 309 + // CraftBukkit start - Check for item breaking
310 -+ if (this.count == 1) {
310 ++ if (this.count == 1 && entityplayer != null) {
311 311 + org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerItemBreakEvent(entityplayer, this);
312 312 + }
313 313 + // CraftBukkit end
314 314
315 315 this.shrink(1);
316 316 consumer.accept(item);
317 317 @@ -693,6 +912,12 @@
318 318 return this.getItem().useOnRelease(this);
319 319 }
320 320

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut