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:
@@ -33,24 +33,24 @@ import appeng.tile.events.TileEventType;
|
||||
public abstract class AENetworkInvTile extends AEBaseInvTile implements IActionHost, IGridProxyable
|
||||
{
|
||||
|
||||
protected final AENetworkProxy gridProxy = new AENetworkProxy( this, "proxy", this.getItemFromTile( this ), true );
|
||||
private final AENetworkProxy gridProxy = new AENetworkProxy( this, "proxy", this.getItemFromTile( this ), true );
|
||||
|
||||
@TileEvent( TileEventType.WORLD_NBT_READ )
|
||||
public void readFromNBT_AENetwork( final NBTTagCompound data )
|
||||
{
|
||||
this.gridProxy.readFromNBT( data );
|
||||
this.getProxy().readFromNBT( data );
|
||||
}
|
||||
|
||||
@TileEvent( TileEventType.WORLD_NBT_WRITE )
|
||||
public void writeToNBT_AENetwork( final NBTTagCompound data )
|
||||
{
|
||||
this.gridProxy.writeToNBT( data );
|
||||
this.getProxy().writeToNBT( data );
|
||||
}
|
||||
|
||||
@Override
|
||||
public AENetworkProxy getProxy()
|
||||
{
|
||||
return this.gridProxy;
|
||||
return this.getProxy();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -62,54 +62,54 @@ public abstract class AENetworkInvTile extends AEBaseInvTile implements IActionH
|
||||
@Override
|
||||
public IGridNode getGridNode( final AEPartLocation dir )
|
||||
{
|
||||
return this.gridProxy.getNode();
|
||||
return this.getProxy().getNode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChunkUnload()
|
||||
{
|
||||
super.onChunkUnload();
|
||||
this.gridProxy.onChunkUnload();
|
||||
this.getProxy().onChunkUnload();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReady()
|
||||
{
|
||||
super.onReady();
|
||||
this.gridProxy.onReady();
|
||||
this.getProxy().onReady();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invalidate()
|
||||
{
|
||||
super.invalidate();
|
||||
this.gridProxy.invalidate();
|
||||
this.getProxy().invalidate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validate()
|
||||
{
|
||||
super.validate();
|
||||
this.gridProxy.validate();
|
||||
this.getProxy().validate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IGridNode getActionableNode()
|
||||
{
|
||||
return this.gridProxy.getNode();
|
||||
return this.getProxy().getNode();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getField(
|
||||
final int id )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getFieldCount()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -35,18 +35,18 @@ import appeng.tile.powersink.AEBasePoweredTile;
|
||||
public abstract class AENetworkPowerTile extends AEBasePoweredTile implements IActionHost, IGridProxyable
|
||||
{
|
||||
|
||||
protected final AENetworkProxy gridProxy = new AENetworkProxy( this, "proxy", this.getItemFromTile( this ), true );
|
||||
private final AENetworkProxy gridProxy = new AENetworkProxy( this, "proxy", this.getItemFromTile( this ), true );
|
||||
|
||||
@TileEvent( TileEventType.WORLD_NBT_READ )
|
||||
public void readFromNBT_AENetwork( final NBTTagCompound data )
|
||||
{
|
||||
this.gridProxy.readFromNBT( data );
|
||||
this.getProxy().readFromNBT( data );
|
||||
}
|
||||
|
||||
@TileEvent( TileEventType.WORLD_NBT_WRITE )
|
||||
public void writeToNBT_AENetwork( final NBTTagCompound data )
|
||||
{
|
||||
this.gridProxy.writeToNBT( data );
|
||||
this.getProxy().writeToNBT( data );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -70,7 +70,7 @@ public abstract class AENetworkPowerTile extends AEBasePoweredTile implements IA
|
||||
@Override
|
||||
public IGridNode getGridNode( final AEPartLocation dir )
|
||||
{
|
||||
return this.gridProxy.getNode();
|
||||
return this.getProxy().getNode();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -83,33 +83,34 @@ public abstract class AENetworkPowerTile extends AEBasePoweredTile implements IA
|
||||
public void validate()
|
||||
{
|
||||
super.validate();
|
||||
this.gridProxy.validate();
|
||||
this.getProxy().validate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invalidate()
|
||||
{
|
||||
super.invalidate();
|
||||
this.gridProxy.invalidate();
|
||||
this.getProxy().invalidate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChunkUnload()
|
||||
{
|
||||
super.onChunkUnload();
|
||||
this.gridProxy.onChunkUnload();
|
||||
this.getProxy().onChunkUnload();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReady()
|
||||
{
|
||||
super.onReady();
|
||||
this.gridProxy.onReady();
|
||||
this.getProxy().onReady();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IGridNode getActionableNode()
|
||||
{
|
||||
return this.gridProxy.getNode();
|
||||
return this.getProxy().getNode();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -35,18 +35,18 @@ import appeng.tile.events.TileEventType;
|
||||
public class AENetworkTile extends AEBaseTile implements IActionHost, IGridProxyable
|
||||
{
|
||||
|
||||
protected final AENetworkProxy gridProxy = this.createProxy();
|
||||
private final AENetworkProxy gridProxy = this.createProxy();
|
||||
|
||||
@TileEvent( TileEventType.WORLD_NBT_READ )
|
||||
public void readFromNBT_AENetwork( final NBTTagCompound data )
|
||||
{
|
||||
this.gridProxy.readFromNBT( data );
|
||||
this.getProxy().readFromNBT( data );
|
||||
}
|
||||
|
||||
@TileEvent( TileEventType.WORLD_NBT_WRITE )
|
||||
public void writeToNBT_AENetwork( final NBTTagCompound data )
|
||||
{
|
||||
this.gridProxy.writeToNBT( data );
|
||||
this.getProxy().writeToNBT( data );
|
||||
}
|
||||
|
||||
protected AENetworkProxy createProxy()
|
||||
@@ -57,7 +57,7 @@ public class AENetworkTile extends AEBaseTile implements IActionHost, IGridProxy
|
||||
@Override
|
||||
public IGridNode getGridNode( final AEPartLocation dir )
|
||||
{
|
||||
return this.gridProxy.getNode();
|
||||
return this.getProxy().getNode();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -70,28 +70,28 @@ public class AENetworkTile extends AEBaseTile implements IActionHost, IGridProxy
|
||||
public void onChunkUnload()
|
||||
{
|
||||
super.onChunkUnload();
|
||||
this.gridProxy.onChunkUnload();
|
||||
this.getProxy().onChunkUnload();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReady()
|
||||
{
|
||||
super.onReady();
|
||||
this.gridProxy.onReady();
|
||||
this.getProxy().onReady();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invalidate()
|
||||
{
|
||||
super.invalidate();
|
||||
this.gridProxy.invalidate();
|
||||
this.getProxy().invalidate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validate()
|
||||
{
|
||||
super.validate();
|
||||
this.gridProxy.validate();
|
||||
this.getProxy().validate();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -115,6 +115,6 @@ public class AENetworkTile extends AEBaseTile implements IActionHost, IGridProxy
|
||||
@Override
|
||||
public IGridNode getActionableNode()
|
||||
{
|
||||
return this.gridProxy.getNode();
|
||||
return this.getProxy().getNode();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user