summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft/server/ItemBlock.java
diff options
context:
space:
mode:
authorfeildmaster <admin@feildmaster.com>2013-01-27 09:13:06 -0600
committerfeildmaster <admin@feildmaster.com>2013-01-27 10:34:59 -0600
commit528bbbdcd896e67067bcf53b95cadb9dc0081ebf (patch)
tree1600354a87373d3d2cf08cd05726999f59b4070b /src/main/java/net/minecraft/server/ItemBlock.java
parent6e438ccb320ed4c3ae5b5f051f3b5580a51c823a (diff)
downloadcraftbukkit-528bbbdcd896e67067bcf53b95cadb9dc0081ebf.tar
craftbukkit-528bbbdcd896e67067bcf53b95cadb9dc0081ebf.tar.gz
craftbukkit-528bbbdcd896e67067bcf53b95cadb9dc0081ebf.tar.lz
craftbukkit-528bbbdcd896e67067bcf53b95cadb9dc0081ebf.tar.xz
craftbukkit-528bbbdcd896e67067bcf53b95cadb9dc0081ebf.zip
Fix TileEntities and Blocks getting out of sync. Fixes BUKKIT-3501
Also fixes: BUKKIT-3477 and BUKKIT-3488 Minecraft likes to double check that tile entities get set after they are placed, however we didn't set tile entities until after our event was called. This caused the world to have multiple tile entities in a single block location; to fix this we now set tile entities before the event.
Diffstat (limited to 'src/main/java/net/minecraft/server/ItemBlock.java')
-rw-r--r--src/main/java/net/minecraft/server/ItemBlock.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main/java/net/minecraft/server/ItemBlock.java b/src/main/java/net/minecraft/server/ItemBlock.java
index 85bdbed4..e6d54bb1 100644
--- a/src/main/java/net/minecraft/server/ItemBlock.java
+++ b/src/main/java/net/minecraft/server/ItemBlock.java
@@ -80,22 +80,25 @@ public class ItemBlock extends Item {
org.bukkit.block.BlockState blockstate = org.bukkit.craftbukkit.block.CraftBlockState.getBlockState(world, x, y, z);
world.suppressPhysics = true;
+ world.callingPlaceEvent = true;
world.setRawTypeIdAndData(x, y, z, id, data);
org.bukkit.event.block.BlockPlaceEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callBlockPlaceEvent(world, entityhuman, blockstate, x, y, z);
if (event.isCancelled() || !event.canBuild()) {
blockstate.update(true);
world.suppressPhysics = false;
+ world.callingPlaceEvent = false;
return false;
}
world.suppressPhysics = false;
+ world.callingPlaceEvent = false;
int newId = world.getTypeId(x, y, z);
int newData = world.getData(x, y, z);
Block block = Block.byId[newId];
- if (block != null) {
+ if (block != null && !(block instanceof BlockContainer)) { // Containers get placed automatically
block.onPlace(world, x, y, z);
}