mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-05 10:20:53 +01:00
SPIGOT-2930: Shift calling of PlayerItemBreakEvent to before break.
This commit is contained in:
parent
7f313269d7
commit
4602331b1d
@ -264,18 +264,18 @@
|
||||
}
|
||||
|
||||
public int k() {
|
||||
@@ -205,6 +392,11 @@
|
||||
entityhuman.b(StatisticList.c(this.item));
|
||||
}
|
||||
|
||||
@@ -198,6 +385,11 @@
|
||||
if (this.f()) {
|
||||
if (this.isDamaged(i, entityliving.getRandom())) {
|
||||
entityliving.b(this);
|
||||
+ // CraftBukkit start - Check for item breaking
|
||||
+ if (this.count == 0 && entityliving instanceof EntityHuman) {
|
||||
+ if (this.count == 1 && entityliving instanceof EntityHuman) {
|
||||
+ org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerItemBreakEvent((EntityHuman) entityliving, this);
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
this.damage = 0;
|
||||
}
|
||||
|
||||
this.subtract(1);
|
||||
if (entityliving instanceof EntityHuman) {
|
||||
EntityHuman entityhuman = (EntityHuman) entityliving;
|
||||
@@ -509,6 +701,12 @@
|
||||
nbttaglist.add(nbttagcompound);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user