Protect reads from world being null

This commit is contained in:
Raoul Van den Berge
2016-11-09 13:41:20 +01:00
parent e3657f693a
commit 1e01243973
2 changed files with 4 additions and 4 deletions

View File

@@ -32,7 +32,9 @@ public abstract class TileBase extends TileEntity implements ITickable {
}
public void updateBlock() {
worldObj.notifyBlockUpdate(pos, worldObj.getBlockState(pos), worldObj.getBlockState(pos), 1 | 2);
if (worldObj != null) {
worldObj.notifyBlockUpdate(pos, worldObj.getBlockState(pos), worldObj.getBlockState(pos), 1 | 2);
}
}
public void setDirection(EnumFacing direction) {

View File

@@ -164,9 +164,7 @@ public class TileDiskDrive extends TileNode implements IItemStorageProvider, IFl
network.getFluidStorageCache().invalidate();
}
if (worldObj != null) {
updateBlock();
}
updateBlock();
}
}