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:
@@ -37,10 +37,10 @@ import appeng.me.GridAccessException;
|
||||
public class PartP2PLiquids extends PartP2PTunnel<PartP2PLiquids> implements IFluidHandler
|
||||
{
|
||||
|
||||
static final ThreadLocal<Stack<PartP2PLiquids>> DEPTH = new ThreadLocal<Stack<PartP2PLiquids>>();
|
||||
private static final ThreadLocal<Stack<PartP2PLiquids>> DEPTH = new ThreadLocal<Stack<PartP2PLiquids>>();
|
||||
private static final FluidTankInfo[] ACTIVE_TANK = { new FluidTankInfo( null, 10000 ) };
|
||||
private static final FluidTankInfo[] INACTIVE_TANK = { new FluidTankInfo( null, 0 ) };
|
||||
IFluidHandler cachedTank;
|
||||
private IFluidHandler cachedTank;
|
||||
private int tmpUsed;
|
||||
|
||||
public PartP2PLiquids( final ItemStack is )
|
||||
@@ -63,7 +63,7 @@ public class PartP2PLiquids extends PartP2PTunnel<PartP2PLiquids> implements IFl
|
||||
public void onNeighborChanged()
|
||||
{
|
||||
this.cachedTank = null;
|
||||
if( this.output )
|
||||
if( this.isOutput() )
|
||||
{
|
||||
final PartP2PLiquids in = this.getInput();
|
||||
if( in != null )
|
||||
@@ -98,7 +98,7 @@ public class PartP2PLiquids extends PartP2PTunnel<PartP2PLiquids> implements IFl
|
||||
final IFluidHandler tank = l.getTarget();
|
||||
if( tank != null )
|
||||
{
|
||||
l.tmpUsed = tank.fill( l.side.getFacing().getOpposite(), resource.copy(), false );
|
||||
l.tmpUsed = tank.fill( l.getSide().getFacing().getOpposite(), resource.copy(), false );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -153,7 +153,7 @@ public class PartP2PLiquids extends PartP2PTunnel<PartP2PLiquids> implements IFl
|
||||
final IFluidHandler tank = l.getTarget();
|
||||
if( tank != null )
|
||||
{
|
||||
l.tmpUsed = tank.fill( l.side.getFacing().getOpposite(), insert.copy(), true );
|
||||
l.tmpUsed = tank.fill( l.getSide().getFacing().getOpposite(), insert.copy(), true );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -184,7 +184,7 @@ public class PartP2PLiquids extends PartP2PTunnel<PartP2PLiquids> implements IFl
|
||||
return s;
|
||||
}
|
||||
|
||||
List<PartP2PLiquids> getOutputs( final Fluid input )
|
||||
private List<PartP2PLiquids> getOutputs( final Fluid input )
|
||||
{
|
||||
final List<PartP2PLiquids> outs = new LinkedList<PartP2PLiquids>();
|
||||
|
||||
@@ -195,7 +195,7 @@ public class PartP2PLiquids extends PartP2PTunnel<PartP2PLiquids> implements IFl
|
||||
final IFluidHandler handler = l.getTarget();
|
||||
if( handler != null )
|
||||
{
|
||||
if( handler.canFill( l.side.getFacing().getOpposite(), input ) )
|
||||
if( handler.canFill( l.getSide().getFacing().getOpposite(), input ) )
|
||||
{
|
||||
outs.add( l );
|
||||
}
|
||||
@@ -210,9 +210,9 @@ public class PartP2PLiquids extends PartP2PTunnel<PartP2PLiquids> implements IFl
|
||||
return outs;
|
||||
}
|
||||
|
||||
IFluidHandler getTarget()
|
||||
private IFluidHandler getTarget()
|
||||
{
|
||||
if( !this.proxy.isActive() )
|
||||
if( !this.getProxy().isActive() )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
@@ -222,7 +222,7 @@ public class PartP2PLiquids extends PartP2PTunnel<PartP2PLiquids> implements IFl
|
||||
return this.cachedTank;
|
||||
}
|
||||
|
||||
final TileEntity te = this.tile.getWorld().getTileEntity( this.tile.getPos().offset( this.side.getFacing() ) );
|
||||
final TileEntity te = this.getTile().getWorld().getTileEntity( this.getTile().getPos().offset( this.getSide().getFacing() ) );
|
||||
if( te instanceof IFluidHandler )
|
||||
{
|
||||
return this.cachedTank = (IFluidHandler) te;
|
||||
@@ -246,7 +246,7 @@ public class PartP2PLiquids extends PartP2PTunnel<PartP2PLiquids> implements IFl
|
||||
@Override
|
||||
public boolean canFill( final EnumFacing from, final Fluid fluid )
|
||||
{
|
||||
return !this.output && from == this.side.getFacing() && !this.getOutputs( fluid ).isEmpty();
|
||||
return !this.isOutput() && from == this.getSide().getFacing() && !this.getOutputs( fluid ).isEmpty();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -258,7 +258,7 @@ public class PartP2PLiquids extends PartP2PTunnel<PartP2PLiquids> implements IFl
|
||||
@Override
|
||||
public FluidTankInfo[] getTankInfo( final EnumFacing from )
|
||||
{
|
||||
if( from == this.side.getFacing() )
|
||||
if( from == this.getSide().getFacing() )
|
||||
{
|
||||
return this.getTank();
|
||||
}
|
||||
@@ -267,7 +267,7 @@ public class PartP2PLiquids extends PartP2PTunnel<PartP2PLiquids> implements IFl
|
||||
|
||||
private FluidTankInfo[] getTank()
|
||||
{
|
||||
if( this.output )
|
||||
if( this.isOutput() )
|
||||
{
|
||||
final PartP2PLiquids tun = this.getInput();
|
||||
if( tun != null )
|
||||
|
||||
Reference in New Issue
Block a user