Fixed crashed in #214 #215

This commit is contained in:
CrazyPants committed 2013-10-28 12:45:44 +08:00
1 parent 4dcb30110a
commit 67bf8d0f2d
2 files changed
+11 -1

No files matched your search

@@ -293,7 +293,11 @@ public abstract class AbstractMachineBlock<T extends AbstractMachineEntity> exte
}
private boolean isActive(IBlockAccess blockAccess, int x, int y, int z) {
return ((AbstractMachineEntity) blockAccess.getBlockTileEntity(x, y, z)).isActive();
TileEntity te = blockAccess.getBlockTileEntity(x, y, z);
if(te instanceof AbstractMachineEntity) {
return ((AbstractMachineEntity) te).isActive();
}
return false;
}
}
@@ -75,7 +75,13 @@ public class TileReservoir extends TileEntity implements IFluidHandler {
if(worldObj == null || worldObj.isRemote) {
return;
}
if(isMaster()) {
//sanity check to prevent crash when moved using redstone in motion
if(regenTank == null || tank == null) {
return;
}
if(regenTank.isFull() && !tank.isFull()) {
++ticksSinceFill;
if(ticksSinceFill >= 20) {