diff options
author | feildmaster <admin@feildmaster.com> | 2013-01-16 20:15:40 -0600 |
---|---|---|
committer | feildmaster <admin@feildmaster.com> | 2013-01-16 20:21:38 -0600 |
commit | ccbd3d84e82e840ed46e2069ea5bac83d8de1551 (patch) | |
tree | f7771edb4ab3a9ac5d1a42796b1b0a3b1535624f /src/main/java/net/minecraft/server/ItemBlock.java | |
parent | 98aea835b5b74f841a0a92567a6987367b542c77 (diff) | |
download | craftbukkit-ccbd3d84e82e840ed46e2069ea5bac83d8de1551.tar craftbukkit-ccbd3d84e82e840ed46e2069ea5bac83d8de1551.tar.gz craftbukkit-ccbd3d84e82e840ed46e2069ea5bac83d8de1551.tar.lz craftbukkit-ccbd3d84e82e840ed46e2069ea5bac83d8de1551.tar.xz craftbukkit-ccbd3d84e82e840ed46e2069ea5bac83d8de1551.zip |
Get the BlockState before changing the block. Fixes BUKKIT-3441
Diffstat (limited to 'src/main/java/net/minecraft/server/ItemBlock.java')
-rw-r--r-- | src/main/java/net/minecraft/server/ItemBlock.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main/java/net/minecraft/server/ItemBlock.java b/src/main/java/net/minecraft/server/ItemBlock.java index 56f74026..05a1567f 100644 --- a/src/main/java/net/minecraft/server/ItemBlock.java +++ b/src/main/java/net/minecraft/server/ItemBlock.java @@ -77,12 +77,14 @@ public class ItemBlock extends Item { // CraftBukkit start - add method to process block placement static boolean processBlockPlace(final World world, final EntityHuman entityhuman, final ItemStack itemstack, final int x, final int y, final int z, final int id, final int data) { + org.bukkit.block.BlockState blockstate = org.bukkit.craftbukkit.block.CraftBlockState.getBlockState(world, x, y, z); + world.suppressPhysics = true; world.setTypeIdAndData(x, y, z, id, data); - org.bukkit.event.block.BlockPlaceEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callBlockPlaceEvent(world, entityhuman, org.bukkit.craftbukkit.block.CraftBlockState.getBlockState(world, x, y, z), x, y, z); + org.bukkit.event.block.BlockPlaceEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callBlockPlaceEvent(world, entityhuman, blockstate, x, y, z); if (event.isCancelled() || !event.canBuild()) { - event.getBlockReplacedState().update(true); + blockstate.update(true); world.suppressPhysics = false; return false; } |