Possibly fixed crashes caused by tile entities under certain circumstances again.

This commit is contained in:
EvilSeph
2011-07-13 19:49:20 -04:00
parent 185d590146
commit c9979169b9
2 changed files with 139 additions and 3 deletions

View File

@@ -1144,14 +1144,20 @@ public class World implements IBlockAccess {
TileEntity tileentity1 = (TileEntity) iterator1.next();
if (!tileentity1.g()) {
if (!this.c.contains(tileentity1)) {
// CraftBukkit - order matters, moved down
/* if (!this.c.contains(tileentity1)) {
this.c.add(tileentity1);
}
} */
Chunk chunk1 = this.getChunkAt(tileentity1.x >> 4, tileentity1.z >> 4);
if (chunk1 != null) {
chunk1.a(tileentity1.x & 15, tileentity1.y, tileentity1.z & 15, tileentity1);
// CraftBukkit start - moved in from above
if (!this.c.contains(tileentity1)) {
this.c.add(tileentity1);
}
// CraftBukkit end
}
this.notify(tileentity1.x, tileentity1.y, tileentity1.z);
@@ -1539,8 +1545,8 @@ public class World implements IBlockAccess {
if (chunk != null) {
chunk.a(i & 15, j, k & 15, tileentity);
this.c.add(tileentity); // CraftBukkit - moved in from above
}
this.c.add(tileentity);
}
}
}