SPIGOT-1018: Fix isFromBonemeal always being false

This commit is contained in:
Thinkofdeath 2015-07-08 22:50:32 +01:00
parent e3b5669be1
commit 7742e12aff

View File

@ -39,7 +39,7 @@
}
@@ -83,11 +100,127 @@
@@ -83,11 +100,128 @@
}
public boolean placeItem(EntityHuman entityhuman, World world, BlockPosition blockposition, EnumDirection enumdirection, float f, float f1, float f2) {
@ -72,7 +72,8 @@
+ world.capturedBlockStates.clear();
+ StructureGrowEvent event = null;
+ if (treeType != null) {
+ event = new StructureGrowEvent(location, treeType, false, (Player) entityhuman.getBukkitEntity(), blocks);
+ boolean isBonemeal = getItem() == Items.DYE && data == 15;
+ event = new StructureGrowEvent(location, treeType, isBonemeal, (Player) entityhuman.getBukkitEntity(), blocks);
+ org.bukkit.Bukkit.getPluginManager().callEvent(event);
+ }
+ if (event == null || !event.isCancelled()) {
@ -168,7 +169,7 @@
return flag;
}
@@ -111,7 +244,7 @@
@@ -111,7 +245,7 @@
nbttagcompound.setByte("Count", (byte) this.count);
nbttagcompound.setShort("Damage", (short) this.damage);
if (this.tag != null) {
@ -177,7 +178,7 @@
}
return nbttagcompound;
@@ -125,13 +258,18 @@
@@ -125,13 +259,18 @@
}
this.count = nbttagcompound.getByte("Count");
@ -197,7 +198,7 @@
if (this.item != null) {
this.item.a(this.tag);
}
@@ -168,8 +306,28 @@
@@ -168,8 +307,28 @@
}
public void setData(int i) {
@ -227,7 +228,7 @@
this.damage = 0;
}
@@ -223,6 +381,12 @@
@@ -223,6 +382,12 @@
this.count = 0;
}
@ -240,7 +241,7 @@
this.damage = 0;
}
@@ -489,6 +653,7 @@
@@ -489,6 +654,7 @@
public void setItem(Item item) {
this.item = item;