Prevent a number of AE2 blocks from reloading a chunk while its unloading.
This commit is contained in:
parent
9510a84c56
commit
53a78fc950
4 changed files with 12 additions and 1 deletions
|
@ -48,6 +48,11 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile,
|
||||||
public int renderFragment = 0;
|
public int renderFragment = 0;
|
||||||
public String customName;
|
public String customName;
|
||||||
|
|
||||||
|
public boolean notLoaded()
|
||||||
|
{
|
||||||
|
return !worldObj.blockExists( xCoord, yCoord, zCoord );
|
||||||
|
}
|
||||||
|
|
||||||
public TileEntity getTile()
|
public TileEntity getTile()
|
||||||
{
|
{
|
||||||
return this;
|
return this;
|
||||||
|
|
|
@ -37,7 +37,7 @@ public class TileCraftingStorageTile extends TileCraftingTile
|
||||||
|
|
||||||
public int getStorageBytes()
|
public int getStorageBytes()
|
||||||
{
|
{
|
||||||
if ( worldObj == null )
|
if ( worldObj == null || notLoaded() )
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
switch (worldObj.getBlockMetadata( xCoord, yCoord, zCoord ) & 3)
|
switch (worldObj.getBlockMetadata( xCoord, yCoord, zCoord ) & 3)
|
||||||
|
|
|
@ -154,6 +154,9 @@ public class TileCraftingTile extends AENetworkTile implements IAEMultiBlock, IP
|
||||||
|
|
||||||
public void updateMeta(boolean updateFormed)
|
public void updateMeta(boolean updateFormed)
|
||||||
{
|
{
|
||||||
|
if ( worldObj == null || notLoaded() )
|
||||||
|
return;
|
||||||
|
|
||||||
boolean formed = isFormed();
|
boolean formed = isFormed();
|
||||||
boolean power = false;
|
boolean power = false;
|
||||||
|
|
||||||
|
|
|
@ -31,6 +31,9 @@ public class TileEnergyCell extends AENetworkTile implements IAEPowerStorage
|
||||||
|
|
||||||
private void changePowerLevel()
|
private void changePowerLevel()
|
||||||
{
|
{
|
||||||
|
if ( notLoaded() )
|
||||||
|
return;
|
||||||
|
|
||||||
byte leel = (byte) (8.0 * (internalCurrentPower / internalMaxPower));
|
byte leel = (byte) (8.0 * (internalCurrentPower / internalMaxPower));
|
||||||
|
|
||||||
if ( leel > 7 )
|
if ( leel > 7 )
|
||||||
|
|
Loading…
Reference in a new issue