summaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
authorTravis Watkins <amaranth@ubuntu.com>2012-11-16 16:46:58 -0600
committerTravis Watkins <amaranth@ubuntu.com>2012-11-16 16:56:49 -0600
commit9add7d3000c15268a0b277aabc224c2acf86cc06 (patch)
treef637018d2705f14c41dbf20b1563b65b0bda2fea /src/main/java
parentd21c5f387111ba4f1fbc3420ce8d0f9da00e32c5 (diff)
downloadcraftbukkit-9add7d3000c15268a0b277aabc224c2acf86cc06.tar
craftbukkit-9add7d3000c15268a0b277aabc224c2acf86cc06.tar.gz
craftbukkit-9add7d3000c15268a0b277aabc224c2acf86cc06.tar.lz
craftbukkit-9add7d3000c15268a0b277aabc224c2acf86cc06.tar.xz
craftbukkit-9add7d3000c15268a0b277aabc224c2acf86cc06.zip
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.
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/net/minecraft/server/Chunk.java6
1 files changed, 6 insertions, 0 deletions
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);