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:
yueh
2015-10-08 15:42:42 +02:00
parent f054bd699b
commit e94a0cfccf
497 changed files with 7865 additions and 6908 deletions
@@ -40,13 +40,13 @@ import appeng.util.Platform;
public class TileQuartzGrowthAccelerator extends AENetworkTile implements IPowerChannelState, ICrystalGrowthAccelerator
{
public boolean hasPower = false;
private boolean hasPower = false;
public TileQuartzGrowthAccelerator()
{
this.gridProxy.setValidSides( EnumSet.noneOf( EnumFacing.class ) );
this.gridProxy.setFlags();
this.gridProxy.setIdlePowerUsage( 8 );
this.getProxy().setValidSides( EnumSet.noneOf( EnumFacing.class ) );
this.getProxy().setFlags();
this.getProxy().setIdlePowerUsage( 8 );
}
@MENetworkEventSubscribe
@@ -64,9 +64,9 @@ public class TileQuartzGrowthAccelerator extends AENetworkTile implements IPower
@TileEvent( TileEventType.NETWORK_READ )
public boolean readFromStream_TileQuartzGrowthAccelerator( final ByteBuf data )
{
final boolean hadPower = this.hasPower;
this.hasPower = data.readBoolean();
return this.hasPower != hadPower;
final boolean hadPower = this.isPowered();
this.setPowered( data.readBoolean() );
return this.isPowered() != hadPower;
}
@TileEvent( TileEventType.NETWORK_WRITE )
@@ -74,7 +74,7 @@ public class TileQuartzGrowthAccelerator extends AENetworkTile implements IPower
{
try
{
data.writeBoolean( this.gridProxy.getEnergy().isNetworkPowered() );
data.writeBoolean( this.getProxy().getEnergy().isNetworkPowered() );
}
catch( final GridAccessException e )
{
@@ -86,7 +86,7 @@ public class TileQuartzGrowthAccelerator extends AENetworkTile implements IPower
public void setOrientation( final EnumFacing inForward, final EnumFacing inUp )
{
super.setOrientation( inForward, inUp );
this.gridProxy.setValidSides( EnumSet.of( this.getUp(), this.getUp().getOpposite() ) );
this.getProxy().setValidSides( EnumSet.of( this.getUp(), this.getUp().getOpposite() ) );
}
@Override
@@ -96,7 +96,7 @@ public class TileQuartzGrowthAccelerator extends AENetworkTile implements IPower
{
try
{
return this.gridProxy.getEnergy().isNetworkPowered();
return this.getProxy().getEnergy().isNetworkPowered();
}
catch( final GridAccessException e )
{
@@ -112,4 +112,9 @@ public class TileQuartzGrowthAccelerator extends AENetworkTile implements IPower
{
return this.isPowered();
}
private void setPowered( final boolean hasPower )
{
this.hasPower = hasPower;
}
}