Direct all BlockPlaceEvents to a singular location. Fixes BUKKIT-3438

By having a single function to process BlockPlacement logic, we make
it so that there is consistent behavior throughout all BlockPlace
events. This should allow for easier troubleshooting and less diffs
in source.

This also fixes BUKKIT-3463 by including the correct coordinates that
were clicked to the event.
This commit is contained in:
feildmaster
2013-01-27 10:44:32 -06:00
parent 528bbbdcd8
commit 899b9c17cc
13 changed files with 57 additions and 141 deletions

View File

@@ -13,6 +13,7 @@ public class ItemSkull 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) {
final int clickedX = i, clickedY = j, clickedZ = k; // CraftBukkit
if (l == 0) {
return false;
} else if (!world.getMaterial(i, j, k).isBuildable()) {
@@ -45,7 +46,7 @@ public class ItemSkull extends Item {
} else {
// CraftBukkit start - handle in ItemBlock
// world.setTypeIdAndData(i, j, k, Block.SKULL.id, l);
if (!ItemBlock.processBlockPlace(world, entityhuman, null, i, j, k, Block.SKULL.id, l)) {
if (!ItemBlock.processBlockPlace(world, entityhuman, null, i, j, k, Block.SKULL.id, l, clickedX, clickedY, clickedZ)) {
return false;
}
l = world.getData(i, j, k);