Prevent a number of AE2 blocks from reloading a chunk while its unloading.

This commit is contained in:
AlgorithmX2 2014-08-21 22:45:56 -05:00
parent 9510a84c56
commit 53a78fc950
4 changed files with 12 additions and 1 deletions

View file

@ -48,6 +48,11 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile,
public int renderFragment = 0;
public String customName;
public boolean notLoaded()
{
return !worldObj.blockExists( xCoord, yCoord, zCoord );
}
public TileEntity getTile()
{
return this;

View file

@ -37,7 +37,7 @@ public class TileCraftingStorageTile extends TileCraftingTile
public int getStorageBytes()
{
if ( worldObj == null )
if ( worldObj == null || notLoaded() )
return 0;
switch (worldObj.getBlockMetadata( xCoord, yCoord, zCoord ) & 3)

View file

@ -154,6 +154,9 @@ public class TileCraftingTile extends AENetworkTile implements IAEMultiBlock, IP
public void updateMeta(boolean updateFormed)
{
if ( worldObj == null || notLoaded() )
return;
boolean formed = isFormed();
boolean power = false;

View file

@ -31,6 +31,9 @@ public class TileEnergyCell extends AENetworkTile implements IAEPowerStorage
private void changePowerLevel()
{
if ( notLoaded() )
return;
byte leel = (byte) (8.0 * (internalCurrentPower / internalMaxPower));
if ( leel > 7 )