Fixed BlockPlace event. Fixes BUKKIT-663

This commit is contained in:
Tahg
2012-01-30 02:19:22 -05:00
committed by EvilSeph
parent 875219e28c
commit 69e766c5f3
3 changed files with 12 additions and 4 deletions

View File

@@ -77,7 +77,11 @@ public class ItemBlock extends Item {
eventUseBlockBelow = itemstack.id == Block.STEP.id && blockStateBelow.getTypeId() == Block.STEP.id;
}
world.suppressPhysics = true;
world.setTypeIdAndData(i, j, k, this.id, this.filterData(itemstack.getData()));
BlockPlaceEvent event = CraftEventFactory.callBlockPlaceEvent(world, entityhuman, eventUseBlockBelow ? blockStateBelow : replacedBlockState, clickedX, clickedY, clickedZ, block);
replacedBlockState.update(true);
world.suppressPhysics = false;
if (event.isCancelled() || !event.canBuild()) {
return true;