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

Call BlockPlaceEvent for cocoa beans planted on log. Adds BUKKIT-5039

The behavior of cocoa are now aligned to be the same as other plants.

Pulled from PR #1281
Dieser Commit ist enthalten in:
BlackHole 2013-12-06 19:06:17 +01:00 committet von feildmaster
Ursprung 36ef37b982
Commit c7b4514ad3

Datei anzeigen

@ -24,6 +24,7 @@ public class ItemDye extends Item {
} }
public boolean interactWith(ItemStack itemstack, EntityHuman entityhuman, World world, int i, int j, int k, int l, float f, float f1, float f2) { public boolean interactWith(ItemStack itemstack, EntityHuman entityhuman, World world, int i, int j, int k, int l, float f, float f1, float f2) {
final int clickedX = i, clickedY = j, clickedZ = k; // CraftBukkit
if (!entityhuman.a(i, j, k, l, itemstack)) { if (!entityhuman.a(i, j, k, l, itemstack)) {
return false; return false;
} else { } else {
@ -67,7 +68,12 @@ public class ItemDye extends Item {
if (world.isEmpty(i, j, k)) { if (world.isEmpty(i, j, k)) {
int j1 = Blocks.COCOA.getPlacedData(world, i, j, k, l, f, f1, f2, 0); int j1 = Blocks.COCOA.getPlacedData(world, i, j, k, l, f, f1, f2, 0);
world.setTypeAndData(i, j, k, Blocks.COCOA, j1, 2); // CraftBukkit start
// world.setTypeAndData(i, j, k, Blocks.COCOA, j1, 2);
if (!ItemBlock.processBlockPlace(world, entityhuman, null, i, j, k, Blocks.COCOA, j1, clickedX, clickedY, clickedZ)) {
return false;
}
// CraftBukkit end
if (!entityhuman.abilities.canInstantlyBuild) { if (!entityhuman.abilities.canInstantlyBuild) {
--itemstack.count; --itemstack.count;
} }