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.
This commit is contained in:
feildmaster
2013-01-27 09:13:06 -06:00
parent 6e438ccb32
commit 528bbbdcd8
3 changed files with 9 additions and 11 deletions

View File

@@ -428,12 +428,9 @@ public class Chunk {
TileEntity tileentity;
if (l != 0) {
if (!this.world.isStatic) {
// CraftBukkit start - Don't "place" if we're processing the event
if (!this.world.suppressPhysics) {
Block.byId[l].onPlace(this.world, j2, j, k2);
}
// CraftBukkit end
// CraftBukkit - Don't place while processing the BlockPlaceEvent, unless it's a BlockContainer
if (!this.world.isStatic && (!this.world.callingPlaceEvent || (Block.byId[l] instanceof BlockContainer))) {
Block.byId[l].onPlace(this.world, j2, j, k2);
}
if (Block.byId[l] instanceof BlockContainer) {