TileBuffer should not return invalid tile entities

This might fix a crash with the Portable Hole.
This commit is contained in:
CovertJaguar 2012-10-19 10:08:18 -07:00
parent 27396299dd
commit 49153e1df9

View file

@ -51,23 +51,29 @@ public class TileBuffer {
public int getBlockID() {
if (tile != null && !tile.isInvalid())
return blockID;
else {
if (tracker.markTimeIfDelay(world, 20))
refresh();
return blockID;
if (tracker.markTimeIfDelay(world, 20)) {
refresh();
if (tile != null && !tile.isInvalid())
return blockID;
}
return 0;
}
public TileEntity getTile() {
if (tile != null && !tile.isInvalid())
return tile;
else {
if (tracker.markTimeIfDelay(world, 20))
refresh();
return tile;
if (tracker.markTimeIfDelay(world, 20)) {
refresh();
if (tile != null && !tile.isInvalid())
return tile;
}
return null;
}
}