final variables and parameters
This commit is contained in:
@@ -43,7 +43,7 @@ public class PartP2PLiquids extends PartP2PTunnel<PartP2PLiquids> implements IFl
|
||||
IFluidHandler cachedTank;
|
||||
private int tmpUsed;
|
||||
|
||||
public PartP2PLiquids( ItemStack is )
|
||||
public PartP2PLiquids( final ItemStack is )
|
||||
{
|
||||
super( is );
|
||||
}
|
||||
@@ -65,7 +65,7 @@ public class PartP2PLiquids extends PartP2PTunnel<PartP2PLiquids> implements IFl
|
||||
this.cachedTank = null;
|
||||
if( this.output )
|
||||
{
|
||||
PartP2PLiquids in = this.getInput();
|
||||
final PartP2PLiquids in = this.getInput();
|
||||
if( in != null )
|
||||
{
|
||||
in.onTunnelNetworkChange();
|
||||
@@ -74,11 +74,11 @@ public class PartP2PLiquids extends PartP2PTunnel<PartP2PLiquids> implements IFl
|
||||
}
|
||||
|
||||
@Override
|
||||
public int fill( EnumFacing from, FluidStack resource, boolean doFill )
|
||||
public int fill( final EnumFacing from, final FluidStack resource, final boolean doFill )
|
||||
{
|
||||
Stack<PartP2PLiquids> stack = this.getDepth();
|
||||
final Stack<PartP2PLiquids> stack = this.getDepth();
|
||||
|
||||
for( PartP2PLiquids t : stack )
|
||||
for( final PartP2PLiquids t : stack )
|
||||
{
|
||||
if( t == this )
|
||||
{
|
||||
@@ -88,14 +88,14 @@ public class PartP2PLiquids extends PartP2PTunnel<PartP2PLiquids> implements IFl
|
||||
|
||||
stack.push( this );
|
||||
|
||||
List<PartP2PLiquids> list = this.getOutputs( resource.getFluid() );
|
||||
final List<PartP2PLiquids> list = this.getOutputs( resource.getFluid() );
|
||||
int requestTotal = 0;
|
||||
|
||||
Iterator<PartP2PLiquids> i = list.iterator();
|
||||
while( i.hasNext() )
|
||||
{
|
||||
PartP2PLiquids l = i.next();
|
||||
IFluidHandler tank = l.getTarget();
|
||||
final PartP2PLiquids l = i.next();
|
||||
final IFluidHandler tank = l.getTarget();
|
||||
if( tank != null )
|
||||
{
|
||||
l.tmpUsed = tank.fill( l.side.getFacing().getOpposite(), resource.copy(), false );
|
||||
@@ -141,16 +141,16 @@ public class PartP2PLiquids extends PartP2PTunnel<PartP2PLiquids> implements IFl
|
||||
int used = 0;
|
||||
while( i.hasNext() )
|
||||
{
|
||||
PartP2PLiquids l = i.next();
|
||||
final PartP2PLiquids l = i.next();
|
||||
|
||||
FluidStack insert = resource.copy();
|
||||
final FluidStack insert = resource.copy();
|
||||
insert.amount = (int) Math.ceil( insert.amount * ( (double) l.tmpUsed / (double) requestTotal ) );
|
||||
if( insert.amount > available )
|
||||
{
|
||||
insert.amount = available;
|
||||
}
|
||||
|
||||
IFluidHandler tank = l.getTarget();
|
||||
final IFluidHandler tank = l.getTarget();
|
||||
if( tank != null )
|
||||
{
|
||||
l.tmpUsed = tank.fill( l.side.getFacing().getOpposite(), insert.copy(), true );
|
||||
@@ -184,15 +184,15 @@ public class PartP2PLiquids extends PartP2PTunnel<PartP2PLiquids> implements IFl
|
||||
return s;
|
||||
}
|
||||
|
||||
List<PartP2PLiquids> getOutputs( Fluid input )
|
||||
List<PartP2PLiquids> getOutputs( final Fluid input )
|
||||
{
|
||||
List<PartP2PLiquids> outs = new LinkedList<PartP2PLiquids>();
|
||||
final List<PartP2PLiquids> outs = new LinkedList<PartP2PLiquids>();
|
||||
|
||||
try
|
||||
{
|
||||
for( PartP2PLiquids l : this.getOutputs() )
|
||||
for( final PartP2PLiquids l : this.getOutputs() )
|
||||
{
|
||||
IFluidHandler handler = l.getTarget();
|
||||
final IFluidHandler handler = l.getTarget();
|
||||
if( handler != null )
|
||||
{
|
||||
if( handler.canFill( l.side.getFacing().getOpposite(), input ) )
|
||||
@@ -202,7 +202,7 @@ public class PartP2PLiquids extends PartP2PTunnel<PartP2PLiquids> implements IFl
|
||||
}
|
||||
}
|
||||
}
|
||||
catch( GridAccessException e )
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
// :P
|
||||
}
|
||||
@@ -222,7 +222,7 @@ public class PartP2PLiquids extends PartP2PTunnel<PartP2PLiquids> implements IFl
|
||||
return this.cachedTank;
|
||||
}
|
||||
|
||||
TileEntity te = this.tile.getWorld().getTileEntity( this.tile.getPos().offset( side.getFacing() ) );
|
||||
final TileEntity te = this.tile.getWorld().getTileEntity( this.tile.getPos().offset( side.getFacing() ) );
|
||||
if( te instanceof IFluidHandler )
|
||||
{
|
||||
return this.cachedTank = (IFluidHandler) te;
|
||||
@@ -232,31 +232,31 @@ public class PartP2PLiquids extends PartP2PTunnel<PartP2PLiquids> implements IFl
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidStack drain( EnumFacing from, FluidStack resource, boolean doDrain )
|
||||
public FluidStack drain( final EnumFacing from, final FluidStack resource, final boolean doDrain )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidStack drain( EnumFacing from, int maxDrain, boolean doDrain )
|
||||
public FluidStack drain( final EnumFacing from, final int maxDrain, final boolean doDrain )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canFill( EnumFacing from, Fluid fluid )
|
||||
public boolean canFill( final EnumFacing from, final Fluid fluid )
|
||||
{
|
||||
return !this.output && from == this.side.getFacing() && !this.getOutputs( fluid ).isEmpty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canDrain( EnumFacing from, Fluid fluid )
|
||||
public boolean canDrain( final EnumFacing from, final Fluid fluid )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTankInfo[] getTankInfo( EnumFacing from )
|
||||
public FluidTankInfo[] getTankInfo( final EnumFacing from )
|
||||
{
|
||||
if( from == this.side.getFacing() )
|
||||
{
|
||||
@@ -269,7 +269,7 @@ public class PartP2PLiquids extends PartP2PTunnel<PartP2PLiquids> implements IFl
|
||||
{
|
||||
if( this.output )
|
||||
{
|
||||
PartP2PLiquids tun = this.getInput();
|
||||
final PartP2PLiquids tun = this.getInput();
|
||||
if( tun != null )
|
||||
{
|
||||
return ACTIVE_TANK;
|
||||
@@ -284,7 +284,7 @@ public class PartP2PLiquids extends PartP2PTunnel<PartP2PLiquids> implements IFl
|
||||
return ACTIVE_TANK;
|
||||
}
|
||||
}
|
||||
catch( GridAccessException e )
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
// :(
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user