Reduces visibility of internal fields/methods
Reduces the visibility of all fields to private and create setters/getters when necessary. Exceptions are fields with GuiSync as these need to be public. Reduces the visibility of internal methods to private/protected/default when possible.
This commit is contained in:
@@ -53,13 +53,13 @@ import appeng.util.Platform;
|
||||
public class TileSpatialIOPort extends AENetworkInvTile implements IWorldCallable<Void>
|
||||
{
|
||||
|
||||
final int[] sides = { 0, 1 };
|
||||
final AppEngInternalInventory inv = new AppEngInternalInventory( this, 2 );
|
||||
YesNo lastRedstoneState = YesNo.UNDECIDED;
|
||||
private final int[] sides = { 0, 1 };
|
||||
private final AppEngInternalInventory inv = new AppEngInternalInventory( this, 2 );
|
||||
private YesNo lastRedstoneState = YesNo.UNDECIDED;
|
||||
|
||||
public TileSpatialIOPort()
|
||||
{
|
||||
this.gridProxy.setFlags( GridFlags.REQUIRE_CHANNEL );
|
||||
this.getProxy().setFlags( GridFlags.REQUIRE_CHANNEL );
|
||||
}
|
||||
|
||||
@TileEvent( TileEventType.WORLD_NBT_WRITE )
|
||||
@@ -128,8 +128,8 @@ public class TileSpatialIOPort extends AENetworkInvTile implements IWorldCallabl
|
||||
final ItemStack cell = this.getStackInSlot( 0 );
|
||||
if( this.isSpatialCell( cell ) && this.getStackInSlot( 1 ) == null )
|
||||
{
|
||||
final IGrid gi = this.gridProxy.getGrid();
|
||||
final IEnergyGrid energy = this.gridProxy.getEnergy();
|
||||
final IGrid gi = this.getProxy().getGrid();
|
||||
final IEnergyGrid energy = this.getProxy().getEnergy();
|
||||
|
||||
final ISpatialStorageCell sc = (ISpatialStorageCell) cell.getItem();
|
||||
|
||||
@@ -179,7 +179,7 @@ public class TileSpatialIOPort extends AENetworkInvTile implements IWorldCallabl
|
||||
@Override
|
||||
public boolean isItemValidForSlot( final int i, final ItemStack itemstack )
|
||||
{
|
||||
return ( i == 0 && this.isSpatialCell( itemstack ) );
|
||||
return( i == 0 && this.isSpatialCell( itemstack ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -53,16 +53,17 @@ public class TileSpatialPylon extends AENetworkTile implements IAEMultiBlock
|
||||
public static final int DISPLAY_ENABLED = 0x10;
|
||||
public static final int DISPLAY_POWERED_ENABLED = 0x20;
|
||||
public static final int NET_STATUS = 0x10 + 0x20;
|
||||
final SpatialPylonCalculator calc = new SpatialPylonCalculator( this );
|
||||
int displayBits = 0;
|
||||
SpatialPylonCluster cluster;
|
||||
boolean didHaveLight = false;
|
||||
|
||||
private final SpatialPylonCalculator calc = new SpatialPylonCalculator( this );
|
||||
private int displayBits = 0;
|
||||
private SpatialPylonCluster cluster;
|
||||
private boolean didHaveLight = false;
|
||||
|
||||
public TileSpatialPylon()
|
||||
{
|
||||
this.gridProxy.setFlags( GridFlags.REQUIRE_CHANNEL, GridFlags.MULTIBLOCK );
|
||||
this.gridProxy.setIdlePowerUsage( 0.5 );
|
||||
this.gridProxy.setValidSides( EnumSet.noneOf( EnumFacing.class ) );
|
||||
this.getProxy().setFlags( GridFlags.REQUIRE_CHANNEL, GridFlags.MULTIBLOCK );
|
||||
this.getProxy().setIdlePowerUsage( 0.5 );
|
||||
this.getProxy().setValidSides( EnumSet.noneOf( EnumFacing.class ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -122,7 +123,7 @@ public class TileSpatialPylon extends AENetworkTile implements IAEMultiBlock
|
||||
public void updateStatus( final SpatialPylonCluster c )
|
||||
{
|
||||
this.cluster = c;
|
||||
this.gridProxy.setValidSides( c == null ? EnumSet.noneOf( EnumFacing.class ) : EnumSet.allOf( EnumFacing.class ) );
|
||||
this.getProxy().setValidSides( c == null ? EnumSet.noneOf( EnumFacing.class ) : EnumSet.allOf( EnumFacing.class ) );
|
||||
this.recalculateDisplay();
|
||||
}
|
||||
|
||||
@@ -134,11 +135,11 @@ public class TileSpatialPylon extends AENetworkTile implements IAEMultiBlock
|
||||
|
||||
if( this.cluster != null )
|
||||
{
|
||||
if( this.cluster.min.equals( this.getLocation() ) )
|
||||
if( this.cluster.getMin().equals( this.getLocation() ) )
|
||||
{
|
||||
this.displayBits = DISPLAY_END_MIN;
|
||||
}
|
||||
else if( this.cluster.max.equals( this.getLocation() ) )
|
||||
else if( this.cluster.getMax().equals( this.getLocation() ) )
|
||||
{
|
||||
this.displayBits = DISPLAY_END_MAX;
|
||||
}
|
||||
@@ -147,7 +148,7 @@ public class TileSpatialPylon extends AENetworkTile implements IAEMultiBlock
|
||||
this.displayBits = DISPLAY_MIDDLE;
|
||||
}
|
||||
|
||||
switch( this.cluster.currentAxis )
|
||||
switch( this.cluster.getCurrentAxis() )
|
||||
{
|
||||
case X:
|
||||
this.displayBits |= DISPLAY_X;
|
||||
@@ -165,12 +166,12 @@ public class TileSpatialPylon extends AENetworkTile implements IAEMultiBlock
|
||||
|
||||
try
|
||||
{
|
||||
if( this.gridProxy.getEnergy().isNetworkPowered() )
|
||||
if( this.getProxy().getEnergy().isNetworkPowered() )
|
||||
{
|
||||
this.displayBits |= DISPLAY_POWERED_ENABLED;
|
||||
}
|
||||
|
||||
if( this.cluster.isValid && this.gridProxy.isActive() )
|
||||
if( this.cluster.isValid() && this.getProxy().isActive() )
|
||||
{
|
||||
this.displayBits |= DISPLAY_ENABLED;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user