3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-18 12:30:06 +01:00

SPIGOT-1018: Fix isFromBonemeal always being false

Dieser Commit ist enthalten in:
Thinkofdeath 2015-07-08 22:50:32 +01:00
Ursprung e3b5669be1
Commit 7742e12aff

Datei anzeigen

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