Fixes #1781 Do not crash after the tileentity was removed

This commit is contained in:
yueh
2015-08-08 14:09:12 +02:00
parent dfb435ae7d
commit d1244f59ed
@@ -143,11 +143,9 @@ public abstract class PartSharedItemBus extends PartUpgradeable implements IGrid
protected boolean canDoBusWork()
{
final TileEntity self = this.getHost().getTile();
final TileEntity target = this.getTileEntity( self, self.xCoord + this.side.offsetX, self.yCoord + this.side.offsetY, self.zCoord + this.side.offsetZ );
final World world = target.getWorldObj();
final int xCoordinate = target.xCoord;
final int zCoordinate = target.zCoord;
final World world = self.getWorldObj();
final int xCoordinate = self.xCoord + this.side.offsetX;
final int zCoordinate = self.zCoord + this.side.offsetZ;
return world != null && world.getChunkProvider().chunkExists( xCoordinate >> 4, zCoordinate >> 4 );
}