From 9add7d3000c15268a0b277aabc224c2acf86cc06 Mon Sep 17 00:00:00 2001 From: Travis Watkins Date: Fri, 16 Nov 2012 16:46:58 -0600 Subject: Don't create tile entity when block placement fails. Fixes BUKKIT-2924 End portals can only be placed in the end during the dragon's death. Attempts to place them outside of this window causes the block to remove itself. However, we still create the tile entity for the portal which leads to exceptions spamming the console about a tile entity existing without the appropriate block. In these cases we should not place the tile entity at all. --- src/main/java/net/minecraft/server/Chunk.java | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/main/java/net/minecraft/server') diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java index 62c71090..8732e7a8 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -437,6 +437,12 @@ public class Chunk { } if (Block.byId[l] instanceof BlockContainer) { + // CraftBukkit start - don't create tile entity if placement failed + if (this.getTypeId(i, j, k) != l) { + return false; + } + // CraftBukkit end + tileentity = this.e(i, j, k); if (tileentity == null) { tileentity = ((BlockContainer) Block.byId[l]).a(this.world); -- cgit v1.2.3