diff options
author | Tahg <tahgtahv@gmail.com> | 2012-01-30 02:19:22 -0500 |
---|---|---|
committer | EvilSeph <evilseph@gmail.com> | 2012-01-30 02:57:58 -0500 |
commit | 69e766c5f3d281038302920d54aea40d57f532d2 (patch) | |
tree | 95703eb8a1e1ce5770e36a5a267e47af55c61045 /src/main/java/net/minecraft/server/ItemRedstone.java | |
parent | 875219e28c07acfe2cfc1d03f889e9f7aac0c28f (diff) | |
download | craftbukkit-69e766c5f3d281038302920d54aea40d57f532d2.tar craftbukkit-69e766c5f3d281038302920d54aea40d57f532d2.tar.gz craftbukkit-69e766c5f3d281038302920d54aea40d57f532d2.tar.lz craftbukkit-69e766c5f3d281038302920d54aea40d57f532d2.tar.xz craftbukkit-69e766c5f3d281038302920d54aea40d57f532d2.zip |
Fixed BlockPlace event. Fixes BUKKIT-663
Diffstat (limited to 'src/main/java/net/minecraft/server/ItemRedstone.java')
-rw-r--r-- | src/main/java/net/minecraft/server/ItemRedstone.java | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/main/java/net/minecraft/server/ItemRedstone.java b/src/main/java/net/minecraft/server/ItemRedstone.java index 69b70561..813c95ef 100644 --- a/src/main/java/net/minecraft/server/ItemRedstone.java +++ b/src/main/java/net/minecraft/server/ItemRedstone.java @@ -49,18 +49,21 @@ public class ItemRedstone extends Item { return false; } else { if (Block.REDSTONE_WIRE.canPlace(world, i, j, k)) { - CraftBlockState blockState = CraftBlockState.getBlockState(world, i, j, k); // CraftBukkit + // CraftBukkit start + CraftBlockState blockState = CraftBlockState.getBlockState(world, i, j, k); - world.setRawTypeId(i, j, k, Block.REDSTONE_WIRE.id); // CraftBukkit - We update after the event + world.suppressPhysics = true; + world.setRawTypeId(i, j, k, Block.REDSTONE_WIRE.id); // We update after the event - // CraftBukkit start - redstone BlockPlaceEvent event = CraftEventFactory.callBlockPlaceEvent(world, entityhuman, blockState, clickedX, clickedY, clickedZ, Block.REDSTONE_WIRE); + blockState.update(true); if (event.isCancelled() || !event.canBuild()) { - event.getBlockPlaced().setTypeIdAndData(blockState.getTypeId(), blockState.getRawData(), false); return false; } + world.suppressPhysics = false; + world.setTypeId(i, j, k, Block.REDSTONE_WIRE.id); world.update(i, j, k, Block.REDSTONE_WIRE.id); // Must take place after BlockPlaceEvent, we need to update all other blocks. // CraftBukkit end |