TileBuffer should not return invalid tile entities
This might fix a crash with the Portable Hole.
This commit is contained in:
parent
27396299dd
commit
49153e1df9
1 changed files with 14 additions and 8 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue