Commits
Doc authored and md_5 committed 98c57cbbee3
300 300 | + } |
301 301 | + // CraftBukkit end |
302 302 | if (i <= 0) { |
303 303 | return; |
304 304 | } |
305 305 | |
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 | |
318 318 | return this.getItem().useOnRelease(this); |
319 319 | } |
320 320 | |