final variables and parameters
This commit is contained in:
@@ -62,7 +62,7 @@ public class PartP2PItems extends PartP2PTunnel<PartP2PItems> implements /*IPipe
|
||||
boolean requested;
|
||||
IInventory cachedInv;
|
||||
|
||||
public PartP2PItems( ItemStack is )
|
||||
public PartP2PItems( final ItemStack is )
|
||||
{
|
||||
super( is );
|
||||
}
|
||||
@@ -71,7 +71,7 @@ public class PartP2PItems extends PartP2PTunnel<PartP2PItems> implements /*IPipe
|
||||
public void onNeighborChanged()
|
||||
{
|
||||
this.cachedInv = null;
|
||||
PartP2PItems input = this.getInput();
|
||||
final PartP2PItems input = this.getInput();
|
||||
if( input != null && this.output )
|
||||
{
|
||||
input.onTunnelNetworkChange();
|
||||
@@ -87,21 +87,21 @@ public class PartP2PItems extends PartP2PTunnel<PartP2PItems> implements /*IPipe
|
||||
return this.cachedInv;
|
||||
}
|
||||
|
||||
List<IInventory> outs = new LinkedList<IInventory>();
|
||||
TunnelCollection<PartP2PItems> itemTunnels;
|
||||
final List<IInventory> outs = new LinkedList<IInventory>();
|
||||
final TunnelCollection<PartP2PItems> itemTunnels;
|
||||
|
||||
try
|
||||
{
|
||||
itemTunnels = this.getOutputs();
|
||||
}
|
||||
catch( GridAccessException e )
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
return new AppEngNullInventory();
|
||||
}
|
||||
|
||||
for( PartP2PItems t : itemTunnels )
|
||||
for( final PartP2PItems t : itemTunnels )
|
||||
{
|
||||
IInventory inv = t.getOutputInv();
|
||||
final IInventory inv = t.getOutputInv();
|
||||
if( inv != null )
|
||||
{
|
||||
if( Platform.getRandomInt() % 2 == 0 )
|
||||
@@ -124,7 +124,7 @@ public class PartP2PItems extends PartP2PTunnel<PartP2PItems> implements /*IPipe
|
||||
|
||||
if( this.proxy.isActive() )
|
||||
{
|
||||
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( this.which.contains( this ) )
|
||||
{
|
||||
@@ -142,7 +142,7 @@ public class PartP2PItems extends PartP2PTunnel<PartP2PItems> implements /*IPipe
|
||||
{
|
||||
output = new WrapperBCPipe( te, this.side.getFacing().getOpposite() );
|
||||
}
|
||||
catch( Throwable ignore )
|
||||
catch( final Throwable ignore )
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -177,15 +177,15 @@ public class PartP2PItems extends PartP2PTunnel<PartP2PItems> implements /*IPipe
|
||||
}
|
||||
|
||||
@Override
|
||||
public TickingRequest getTickingRequest( IGridNode node )
|
||||
public TickingRequest getTickingRequest( final IGridNode node )
|
||||
{
|
||||
return new TickingRequest( TickRates.ItemTunnel.min, TickRates.ItemTunnel.max, false, false );
|
||||
}
|
||||
|
||||
@Override
|
||||
public TickRateModulation tickingRequest( IGridNode node, int ticksSinceLastCall )
|
||||
public TickRateModulation tickingRequest( final IGridNode node, final int ticksSinceLastCall )
|
||||
{
|
||||
boolean wasReq = this.requested;
|
||||
final boolean wasReq = this.requested;
|
||||
|
||||
if( this.requested && this.cachedInv != null )
|
||||
{
|
||||
@@ -197,12 +197,12 @@ public class PartP2PItems extends PartP2PTunnel<PartP2PItems> implements /*IPipe
|
||||
}
|
||||
|
||||
@MENetworkEventSubscribe
|
||||
public void changeStateA( MENetworkBootingStatusChange bs )
|
||||
public void changeStateA( final MENetworkBootingStatusChange bs )
|
||||
{
|
||||
if( !this.output )
|
||||
{
|
||||
this.cachedInv = null;
|
||||
int olderSize = this.oldSize;
|
||||
final int olderSize = this.oldSize;
|
||||
this.oldSize = this.getDestination().getSizeInventory();
|
||||
if( olderSize != this.oldSize )
|
||||
{
|
||||
@@ -212,12 +212,12 @@ public class PartP2PItems extends PartP2PTunnel<PartP2PItems> implements /*IPipe
|
||||
}
|
||||
|
||||
@MENetworkEventSubscribe
|
||||
public void changeStateB( MENetworkChannelsChanged bs )
|
||||
public void changeStateB( final MENetworkChannelsChanged bs )
|
||||
{
|
||||
if( !this.output )
|
||||
{
|
||||
this.cachedInv = null;
|
||||
int olderSize = this.oldSize;
|
||||
final int olderSize = this.oldSize;
|
||||
this.oldSize = this.getDestination().getSizeInventory();
|
||||
if( olderSize != this.oldSize )
|
||||
{
|
||||
@@ -227,12 +227,12 @@ public class PartP2PItems extends PartP2PTunnel<PartP2PItems> implements /*IPipe
|
||||
}
|
||||
|
||||
@MENetworkEventSubscribe
|
||||
public void changeStateC( MENetworkPowerStatusChange bs )
|
||||
public void changeStateC( final MENetworkPowerStatusChange bs )
|
||||
{
|
||||
if( !this.output )
|
||||
{
|
||||
this.cachedInv = null;
|
||||
int olderSize = this.oldSize;
|
||||
final int olderSize = this.oldSize;
|
||||
this.oldSize = this.getDestination().getSizeInventory();
|
||||
if( olderSize != this.oldSize )
|
||||
{
|
||||
@@ -247,7 +247,7 @@ public class PartP2PItems extends PartP2PTunnel<PartP2PItems> implements /*IPipe
|
||||
if( !this.output )
|
||||
{
|
||||
this.cachedInv = null;
|
||||
int olderSize = this.oldSize;
|
||||
final int olderSize = this.oldSize;
|
||||
this.oldSize = this.getDestination().getSizeInventory();
|
||||
if( olderSize != this.oldSize )
|
||||
{
|
||||
@@ -256,7 +256,7 @@ public class PartP2PItems extends PartP2PTunnel<PartP2PItems> implements /*IPipe
|
||||
}
|
||||
else
|
||||
{
|
||||
PartP2PItems input = this.getInput();
|
||||
final PartP2PItems input = this.getInput();
|
||||
if( input != null )
|
||||
{
|
||||
input.getHost().notifyNeighbors();
|
||||
@@ -266,9 +266,9 @@ public class PartP2PItems extends PartP2PTunnel<PartP2PItems> implements /*IPipe
|
||||
|
||||
@Override
|
||||
public int[] getSlotsForFace(
|
||||
EnumFacing side )
|
||||
final EnumFacing side )
|
||||
{
|
||||
int[] slots = new int[this.getSizeInventory()];
|
||||
final int[] slots = new int[this.getSizeInventory()];
|
||||
for( int x = 0; x < this.getSizeInventory(); x++ )
|
||||
{
|
||||
slots[x] = x;
|
||||
@@ -283,25 +283,25 @@ public class PartP2PItems extends PartP2PTunnel<PartP2PItems> implements /*IPipe
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlot( int i )
|
||||
public ItemStack getStackInSlot( final int i )
|
||||
{
|
||||
return this.getDestination().getStackInSlot( i );
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack decrStackSize( int i, int j )
|
||||
public ItemStack decrStackSize( final int i, final int j )
|
||||
{
|
||||
return this.getDestination().decrStackSize( i, j );
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlotOnClosing( int i )
|
||||
public ItemStack getStackInSlotOnClosing( final int i )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInventorySlotContents( int i, ItemStack itemstack )
|
||||
public void setInventorySlotContents( final int i, final ItemStack itemstack )
|
||||
{
|
||||
this.getDestination().setInventorySlotContents( i, itemstack );
|
||||
}
|
||||
@@ -331,35 +331,35 @@ public class PartP2PItems extends PartP2PTunnel<PartP2PItems> implements /*IPipe
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUseableByPlayer( EntityPlayer entityplayer )
|
||||
public boolean isUseableByPlayer( final EntityPlayer entityplayer )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openInventory(EntityPlayer p)
|
||||
public void openInventory( final EntityPlayer p)
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void closeInventory(EntityPlayer p)
|
||||
public void closeInventory( final EntityPlayer p)
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot( int i, net.minecraft.item.ItemStack itemstack )
|
||||
public boolean isItemValidForSlot( final int i, final net.minecraft.item.ItemStack itemstack )
|
||||
{
|
||||
return this.getDestination().isItemValidForSlot( i, itemstack );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInsertItem( int i, ItemStack itemstack, EnumFacing j )
|
||||
public boolean canInsertItem( final int i, final ItemStack itemstack, final EnumFacing j )
|
||||
{
|
||||
return this.getDestination().isItemValidForSlot( i, itemstack );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem( int i, ItemStack itemstack, EnumFacing j )
|
||||
public boolean canExtractItem( final int i, final ItemStack itemstack, final EnumFacing j )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -370,7 +370,7 @@ public class PartP2PItems extends PartP2PTunnel<PartP2PItems> implements /*IPipe
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getField( int id )
|
||||
public int getField( final int id )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -384,8 +384,8 @@ public class PartP2PItems extends PartP2PTunnel<PartP2PItems> implements /*IPipe
|
||||
|
||||
@Override
|
||||
public void setField(
|
||||
int id,
|
||||
int value )
|
||||
final int id,
|
||||
final int value )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -43,34 +43,34 @@ public class PartP2PLight extends PartP2PTunnel<PartP2PLight> implements IGridTi
|
||||
int lastValue = 0;
|
||||
float opacity = -1;
|
||||
|
||||
public PartP2PLight( ItemStack is )
|
||||
public PartP2PLight( final ItemStack is )
|
||||
{
|
||||
super( is );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void chanRender( MENetworkChannelsChanged c )
|
||||
public void chanRender( final MENetworkChannelsChanged c )
|
||||
{
|
||||
this.onTunnelNetworkChange();
|
||||
super.chanRender( c );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void powerRender( MENetworkPowerStatusChange c )
|
||||
public void powerRender( final MENetworkPowerStatusChange c )
|
||||
{
|
||||
this.onTunnelNetworkChange();
|
||||
super.powerRender( c );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToStream( ByteBuf data ) throws IOException
|
||||
public void writeToStream( final ByteBuf data ) throws IOException
|
||||
{
|
||||
super.writeToStream( data );
|
||||
data.writeInt( this.output ? this.lastValue : 0 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean readFromStream( ByteBuf data ) throws IOException
|
||||
public boolean readFromStream( final ByteBuf data ) throws IOException
|
||||
{
|
||||
super.readFromStream( data );
|
||||
this.lastValue = data.readInt();
|
||||
@@ -85,22 +85,22 @@ public class PartP2PLight extends PartP2PTunnel<PartP2PLight> implements IGridTi
|
||||
return false;
|
||||
}
|
||||
|
||||
TileEntity te = this.getTile();
|
||||
World w = te.getWorld();
|
||||
final TileEntity te = this.getTile();
|
||||
final World w = te.getWorld();
|
||||
|
||||
int newLevel = w.getLight( te.getPos().offset( side.getFacing() ) );
|
||||
final int newLevel = w.getLight( te.getPos().offset( side.getFacing() ) );
|
||||
|
||||
if( this.lastValue != newLevel && this.proxy.isActive() )
|
||||
{
|
||||
this.lastValue = newLevel;
|
||||
try
|
||||
{
|
||||
for( PartP2PLight out : this.getOutputs() )
|
||||
for( final PartP2PLight out : this.getOutputs() )
|
||||
{
|
||||
out.setLightLevel( this.lastValue );
|
||||
}
|
||||
}
|
||||
catch( GridAccessException e )
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
// :P
|
||||
}
|
||||
@@ -133,17 +133,17 @@ public class PartP2PLight extends PartP2PTunnel<PartP2PLight> implements IGridTi
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void setLightLevel( int out )
|
||||
public void setLightLevel( final int out )
|
||||
{
|
||||
this.lastValue = out;
|
||||
this.getHost().markForUpdate();
|
||||
}
|
||||
|
||||
private int blockLight( int emit )
|
||||
private int blockLight( final int emit )
|
||||
{
|
||||
if( this.opacity < 0 )
|
||||
{
|
||||
TileEntity te = this.getTile();
|
||||
final TileEntity te = this.getTile();
|
||||
this.opacity = 255 - te.getWorld().getBlockLightOpacity( te.getPos().offset( side.getFacing() ) );
|
||||
}
|
||||
|
||||
@@ -151,7 +151,7 @@ public class PartP2PLight extends PartP2PTunnel<PartP2PLight> implements IGridTi
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT( NBTTagCompound tag )
|
||||
public void readFromNBT( final NBTTagCompound tag )
|
||||
{
|
||||
super.readFromNBT( tag );
|
||||
if( tag.hasKey( "opacity" ) )
|
||||
@@ -162,7 +162,7 @@ public class PartP2PLight extends PartP2PTunnel<PartP2PLight> implements IGridTi
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT( NBTTagCompound tag )
|
||||
public void writeToNBT( final NBTTagCompound tag )
|
||||
{
|
||||
super.writeToNBT( tag );
|
||||
tag.setFloat( "opacity", this.opacity );
|
||||
@@ -180,7 +180,7 @@ public class PartP2PLight extends PartP2PTunnel<PartP2PLight> implements IGridTi
|
||||
{
|
||||
if( this.output )
|
||||
{
|
||||
PartP2PLight src = this.getInput();
|
||||
final PartP2PLight src = this.getInput();
|
||||
if( src != null && src.proxy.isActive() )
|
||||
{
|
||||
this.setLightLevel( src.lastValue );
|
||||
@@ -197,13 +197,13 @@ public class PartP2PLight extends PartP2PTunnel<PartP2PLight> implements IGridTi
|
||||
}
|
||||
|
||||
@Override
|
||||
public TickingRequest getTickingRequest( IGridNode node )
|
||||
public TickingRequest getTickingRequest( final IGridNode node )
|
||||
{
|
||||
return new TickingRequest( TickRates.LightTunnel.min, TickRates.LightTunnel.max, false, false );
|
||||
}
|
||||
|
||||
@Override
|
||||
public TickRateModulation tickingRequest( IGridNode node, int ticksSinceLastCall )
|
||||
public TickRateModulation tickingRequest( final IGridNode node, final int ticksSinceLastCall )
|
||||
{
|
||||
return this.doWork() ? TickRateModulation.FASTER : TickRateModulation.SLOWER;
|
||||
}
|
||||
|
||||
@@ -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 )
|
||||
{
|
||||
// :(
|
||||
}
|
||||
|
||||
@@ -41,13 +41,13 @@ public class PartP2PRedstone extends PartP2PTunnel<PartP2PRedstone>
|
||||
int power;
|
||||
boolean recursive = false;
|
||||
|
||||
public PartP2PRedstone( ItemStack is )
|
||||
public PartP2PRedstone( final ItemStack is )
|
||||
{
|
||||
super( is );
|
||||
}
|
||||
|
||||
@MENetworkEventSubscribe
|
||||
public void changeStateA( MENetworkBootingStatusChange bs )
|
||||
public void changeStateA( final MENetworkBootingStatusChange bs )
|
||||
{
|
||||
this.setNetworkReady();
|
||||
}
|
||||
@@ -56,7 +56,7 @@ public class PartP2PRedstone extends PartP2PTunnel<PartP2PRedstone>
|
||||
{
|
||||
if( this.output )
|
||||
{
|
||||
PartP2PRedstone in = this.getInput();
|
||||
final PartP2PRedstone in = this.getInput();
|
||||
if( in != null )
|
||||
{
|
||||
this.putInput( in.power );
|
||||
@@ -64,7 +64,7 @@ public class PartP2PRedstone extends PartP2PTunnel<PartP2PRedstone>
|
||||
}
|
||||
}
|
||||
|
||||
protected void putInput( Object o )
|
||||
protected void putInput( final Object o )
|
||||
{
|
||||
if( this.recursive )
|
||||
{
|
||||
@@ -74,7 +74,7 @@ public class PartP2PRedstone extends PartP2PTunnel<PartP2PRedstone>
|
||||
this.recursive = true;
|
||||
if( this.output && this.proxy.isActive() )
|
||||
{
|
||||
int newPower = (Integer) o;
|
||||
final int newPower = (Integer) o;
|
||||
if( this.power != newPower )
|
||||
{
|
||||
this.power = newPower;
|
||||
@@ -86,36 +86,36 @@ public class PartP2PRedstone extends PartP2PTunnel<PartP2PRedstone>
|
||||
|
||||
public void notifyNeighbors()
|
||||
{
|
||||
World worldObj = this.tile.getWorld();
|
||||
final World worldObj = this.tile.getWorld();
|
||||
|
||||
Platform.notifyBlocksOfNeighbors( worldObj,tile.getPos());
|
||||
|
||||
// and this cause sometimes it can go thought walls.
|
||||
for ( EnumFacing face : EnumFacing.VALUES )
|
||||
for ( final EnumFacing face : EnumFacing.VALUES )
|
||||
Platform.notifyBlocksOfNeighbors( worldObj,tile.getPos().offset( face ) );
|
||||
}
|
||||
|
||||
@MENetworkEventSubscribe
|
||||
public void changeStateB( MENetworkChannelsChanged bs )
|
||||
public void changeStateB( final MENetworkChannelsChanged bs )
|
||||
{
|
||||
this.setNetworkReady();
|
||||
}
|
||||
|
||||
@MENetworkEventSubscribe
|
||||
public void changeStateC( MENetworkPowerStatusChange bs )
|
||||
public void changeStateC( final MENetworkPowerStatusChange bs )
|
||||
{
|
||||
this.setNetworkReady();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT( NBTTagCompound tag )
|
||||
public void readFromNBT( final NBTTagCompound tag )
|
||||
{
|
||||
super.readFromNBT( tag );
|
||||
this.power = tag.getInteger( "power" );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT( NBTTagCompound tag )
|
||||
public void writeToNBT( final NBTTagCompound tag )
|
||||
{
|
||||
super.writeToNBT( tag );
|
||||
tag.setInteger( "power", this.power );
|
||||
@@ -137,10 +137,10 @@ public class PartP2PRedstone extends PartP2PTunnel<PartP2PRedstone>
|
||||
{
|
||||
if( !this.output )
|
||||
{
|
||||
BlockPos target = tile.getPos().offset( side.getFacing() );
|
||||
final BlockPos target = tile.getPos().offset( side.getFacing() );
|
||||
|
||||
IBlockState state = this.tile.getWorld().getBlockState( target );
|
||||
Block b = state.getBlock();
|
||||
final IBlockState state = this.tile.getWorld().getBlockState( target );
|
||||
final Block b = state.getBlock();
|
||||
if( b != null && !this.output )
|
||||
{
|
||||
EnumFacing srcSide = this.side.getFacing();
|
||||
@@ -178,16 +178,16 @@ public class PartP2PRedstone extends PartP2PTunnel<PartP2PRedstone>
|
||||
return this.output ? this.power : 0;
|
||||
}
|
||||
|
||||
private void sendToOutput( int power )
|
||||
private void sendToOutput( final int power )
|
||||
{
|
||||
try
|
||||
{
|
||||
for( PartP2PRedstone rs : this.getOutputs() )
|
||||
for( final PartP2PRedstone rs : this.getOutputs() )
|
||||
{
|
||||
rs.putInput( power );
|
||||
}
|
||||
}
|
||||
catch( GridAccessException e )
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
// :P
|
||||
}
|
||||
|
||||
@@ -65,12 +65,12 @@ public abstract class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicSt
|
||||
public boolean output;
|
||||
public long freq;
|
||||
|
||||
public PartP2PTunnel( ItemStack is )
|
||||
public PartP2PTunnel( final ItemStack is )
|
||||
{
|
||||
super( is );
|
||||
}
|
||||
|
||||
public TunnelCollection<T> getCollection( Collection<PartP2PTunnel> collection, Class<? extends PartP2PTunnel> c )
|
||||
public TunnelCollection<T> getCollection( final Collection<PartP2PTunnel> collection, final Class<? extends PartP2PTunnel> c )
|
||||
{
|
||||
if( this.type.matches( c ) )
|
||||
{
|
||||
@@ -88,16 +88,15 @@ public abstract class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicSt
|
||||
return null;
|
||||
}
|
||||
|
||||
PartP2PTunnel tunnel;
|
||||
try
|
||||
{
|
||||
tunnel = this.proxy.getP2P().getInput( this.freq );
|
||||
final PartP2PTunnel tunnel = this.proxy.getP2P().getInput( this.freq );
|
||||
if( this.getClass().isInstance( tunnel ) )
|
||||
{
|
||||
return (T) tunnel;
|
||||
}
|
||||
}
|
||||
catch( GridAccessException e )
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
// :P
|
||||
}
|
||||
@@ -114,7 +113,7 @@ public abstract class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicSt
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getBoxes( IPartCollisionHelper bch )
|
||||
public void getBoxes( final IPartCollisionHelper bch )
|
||||
{
|
||||
bch.addBox( 5, 5, 12, 11, 11, 13 );
|
||||
bch.addBox( 3, 3, 13, 13, 13, 14 );
|
||||
@@ -123,7 +122,7 @@ public abstract class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicSt
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderInventory( IPartRenderHelper rh, ModelGenerator renderer )
|
||||
public void renderInventory( final IPartRenderHelper rh, final ModelGenerator renderer )
|
||||
{
|
||||
rh.setTexture( this.getTypeTexture(renderer) );
|
||||
|
||||
@@ -140,7 +139,7 @@ public abstract class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicSt
|
||||
* @param renderer
|
||||
* @return If enabled it returns the icon of an AE quartz block, else vanilla quartz block icon
|
||||
*/
|
||||
protected IAESprite getTypeTexture(ModelGenerator renderer )
|
||||
protected IAESprite getTypeTexture( final ModelGenerator renderer )
|
||||
{
|
||||
final Optional<Block> maybeBlock = AEApi.instance().definitions().blocks().quartz().maybeBlock();
|
||||
if( maybeBlock.isPresent() )
|
||||
@@ -155,7 +154,7 @@ public abstract class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicSt
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderStatic( BlockPos pos, IPartRenderHelper rh, ModelGenerator renderer )
|
||||
public void renderStatic( final BlockPos pos, final IPartRenderHelper rh, final ModelGenerator renderer )
|
||||
{
|
||||
rh.setTexture( this.getTypeTexture(renderer) );
|
||||
|
||||
@@ -182,7 +181,7 @@ public abstract class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicSt
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getItemStack( PartItemStack type )
|
||||
public ItemStack getItemStack( final PartItemStack type )
|
||||
{
|
||||
if( type == PartItemStack.World || type == PartItemStack.Network || type == PartItemStack.Wrench || type == PartItemStack.Pick )
|
||||
{
|
||||
@@ -199,7 +198,7 @@ public abstract class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicSt
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT( NBTTagCompound data )
|
||||
public void readFromNBT( final NBTTagCompound data )
|
||||
{
|
||||
super.readFromNBT( data );
|
||||
this.output = data.getBoolean( "output" );
|
||||
@@ -207,7 +206,7 @@ public abstract class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicSt
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT( NBTTagCompound data )
|
||||
public void writeToNBT( final NBTTagCompound data )
|
||||
{
|
||||
super.writeToNBT( data );
|
||||
data.setBoolean( "output", this.output );
|
||||
@@ -227,44 +226,44 @@ public abstract class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicSt
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onPartActivate( EntityPlayer player, Vec3 pos )
|
||||
public boolean onPartActivate( final EntityPlayer player, final Vec3 pos )
|
||||
{
|
||||
ItemStack is = player.inventory.getCurrentItem();
|
||||
final ItemStack is = player.inventory.getCurrentItem();
|
||||
|
||||
// UniqueIdentifier id = GameRegistry.findUniqueIdentifierFor( is.getItem() );
|
||||
// AELog.info( "ID:" + id.toString() + " : " + is.getItemDamage() );
|
||||
|
||||
TunnelType tt = AEApi.instance().registries().p2pTunnel().getTunnelTypeByItem( is );
|
||||
final TunnelType tt = AEApi.instance().registries().p2pTunnel().getTunnelTypeByItem( is );
|
||||
if( is != null && is.getItem() instanceof IMemoryCard )
|
||||
{
|
||||
IMemoryCard mc = (IMemoryCard) is.getItem();
|
||||
NBTTagCompound data = mc.getData( is );
|
||||
final IMemoryCard mc = (IMemoryCard) is.getItem();
|
||||
final NBTTagCompound data = mc.getData( is );
|
||||
|
||||
ItemStack newType = ItemStack.loadItemStackFromNBT( data );
|
||||
long freq = data.getLong( "freq" );
|
||||
final ItemStack newType = ItemStack.loadItemStackFromNBT( data );
|
||||
final long freq = data.getLong( "freq" );
|
||||
|
||||
if( newType != null )
|
||||
{
|
||||
if( newType.getItem() instanceof IPartItem )
|
||||
{
|
||||
IPart testPart = ( (IPartItem) newType.getItem() ).createPartFromItemStack( newType );
|
||||
final IPart testPart = ( (IPartItem) newType.getItem() ).createPartFromItemStack( newType );
|
||||
if( testPart instanceof PartP2PTunnel )
|
||||
{
|
||||
this.getHost().removePart( this.side, true );
|
||||
AEPartLocation dir = this.getHost().addPart( newType, this.side, player );
|
||||
IPart newBus = this.getHost().getPart( dir );
|
||||
final AEPartLocation dir = this.getHost().addPart( newType, this.side, player );
|
||||
final IPart newBus = this.getHost().getPart( dir );
|
||||
|
||||
if( newBus instanceof PartP2PTunnel )
|
||||
{
|
||||
PartP2PTunnel newTunnel = (PartP2PTunnel) newBus;
|
||||
final PartP2PTunnel newTunnel = (PartP2PTunnel) newBus;
|
||||
newTunnel.output = true;
|
||||
|
||||
try
|
||||
{
|
||||
P2PCache p2p = newTunnel.proxy.getP2P();
|
||||
final P2PCache p2p = newTunnel.proxy.getP2P();
|
||||
p2p.updateFreq( newTunnel, freq );
|
||||
}
|
||||
catch( GridAccessException e )
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
// :P
|
||||
}
|
||||
@@ -288,7 +287,7 @@ public abstract class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicSt
|
||||
switch( tt )
|
||||
{
|
||||
case LIGHT:
|
||||
for( ItemStack stack : parts.p2PTunnelLight().maybeStack( 1 ).asSet() )
|
||||
for( final ItemStack stack : parts.p2PTunnelLight().maybeStack( 1 ).asSet() )
|
||||
{
|
||||
newType = stack;
|
||||
}
|
||||
@@ -304,7 +303,7 @@ public abstract class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicSt
|
||||
*/
|
||||
|
||||
case FLUID:
|
||||
for( ItemStack stack : parts.p2PTunnelLiquids().maybeStack( 1 ).asSet() )
|
||||
for( final ItemStack stack : parts.p2PTunnelLiquids().maybeStack( 1 ).asSet() )
|
||||
{
|
||||
newType = stack;
|
||||
}
|
||||
@@ -320,21 +319,21 @@ public abstract class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicSt
|
||||
*/
|
||||
|
||||
case ITEM:
|
||||
for( ItemStack stack : parts.p2PTunnelItems().maybeStack( 1 ).asSet() )
|
||||
for( final ItemStack stack : parts.p2PTunnelItems().maybeStack( 1 ).asSet() )
|
||||
{
|
||||
newType = stack;
|
||||
}
|
||||
break;
|
||||
|
||||
case ME:
|
||||
for( ItemStack stack : parts.p2PTunnelME().maybeStack( 1 ).asSet() )
|
||||
for( final ItemStack stack : parts.p2PTunnelME().maybeStack( 1 ).asSet() )
|
||||
{
|
||||
newType = stack;
|
||||
}
|
||||
break;
|
||||
|
||||
case REDSTONE:
|
||||
for( ItemStack stack : parts.p2PTunnelRedstone().maybeStack( 1 ).asSet() )
|
||||
for( final ItemStack stack : parts.p2PTunnelRedstone().maybeStack( 1 ).asSet() )
|
||||
{
|
||||
newType = stack;
|
||||
}
|
||||
@@ -363,25 +362,25 @@ public abstract class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicSt
|
||||
|
||||
if( newType != null && !Platform.isSameItem( newType, this.is ) )
|
||||
{
|
||||
boolean oldOutput = this.output;
|
||||
long myFreq = this.freq;
|
||||
final boolean oldOutput = this.output;
|
||||
final long myFreq = this.freq;
|
||||
|
||||
this.getHost().removePart( this.side, false );
|
||||
AEPartLocation dir = this.getHost().addPart( newType, this.side, player );
|
||||
IPart newBus = this.getHost().getPart( dir );
|
||||
final AEPartLocation dir = this.getHost().addPart( newType, this.side, player );
|
||||
final IPart newBus = this.getHost().getPart( dir );
|
||||
|
||||
if( newBus instanceof PartP2PTunnel )
|
||||
{
|
||||
PartP2PTunnel newTunnel = (PartP2PTunnel) newBus;
|
||||
final PartP2PTunnel newTunnel = (PartP2PTunnel) newBus;
|
||||
newTunnel.output = oldOutput;
|
||||
newTunnel.onTunnelNetworkChange();
|
||||
|
||||
try
|
||||
{
|
||||
P2PCache p2p = newTunnel.proxy.getP2P();
|
||||
final P2PCache p2p = newTunnel.proxy.getP2P();
|
||||
p2p.updateFreq( newTunnel, myFreq );
|
||||
}
|
||||
catch( GridAccessException e )
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
// :P
|
||||
}
|
||||
@@ -396,16 +395,16 @@ public abstract class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicSt
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onPartShiftActivate( EntityPlayer player, Vec3 pos )
|
||||
public boolean onPartShiftActivate( final EntityPlayer player, final Vec3 pos )
|
||||
{
|
||||
ItemStack is = player.inventory.getCurrentItem();
|
||||
final ItemStack is = player.inventory.getCurrentItem();
|
||||
if( is != null && is.getItem() instanceof IMemoryCard )
|
||||
{
|
||||
IMemoryCard mc = (IMemoryCard) is.getItem();
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
final IMemoryCard mc = (IMemoryCard) is.getItem();
|
||||
final NBTTagCompound data = new NBTTagCompound();
|
||||
|
||||
long newFreq = this.freq;
|
||||
boolean wasOutput = this.output;
|
||||
final boolean wasOutput = this.output;
|
||||
this.output = false;
|
||||
|
||||
if( wasOutput || this.freq == 0 )
|
||||
@@ -417,15 +416,15 @@ public abstract class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicSt
|
||||
{
|
||||
this.proxy.getP2P().updateFreq( this, newFreq );
|
||||
}
|
||||
catch( GridAccessException e )
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
// :P
|
||||
}
|
||||
|
||||
this.onTunnelConfigChange();
|
||||
|
||||
ItemStack p2pItem = this.getItemStack( PartItemStack.Wrench );
|
||||
String type = p2pItem.getUnlocalizedName();
|
||||
final ItemStack p2pItem = this.getItemStack( PartItemStack.Wrench );
|
||||
final String type = p2pItem.getUnlocalizedName();
|
||||
|
||||
p2pItem.writeToNBT( data );
|
||||
data.setLong( "freq", this.freq );
|
||||
@@ -448,20 +447,20 @@ public abstract class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicSt
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public TextureAtlasSprite getBreakingTexture( ModelGenerator renderer )
|
||||
public TextureAtlasSprite getBreakingTexture( final ModelGenerator renderer )
|
||||
{
|
||||
return CableBusTextures.BlockP2PTunnel2.getIcon().getAtlas();
|
||||
}
|
||||
|
||||
protected void queueTunnelDrain( PowerUnits unit, double f )
|
||||
protected void queueTunnelDrain( final PowerUnits unit, final double f )
|
||||
{
|
||||
double ae_to_tax = unit.convertTo( PowerUnits.AE, f * AEConfig.TUNNEL_POWER_LOSS );
|
||||
final double ae_to_tax = unit.convertTo( PowerUnits.AE, f * AEConfig.TUNNEL_POWER_LOSS );
|
||||
|
||||
try
|
||||
{
|
||||
this.proxy.getEnergy().extractAEPower( ae_to_tax, Actionable.MODULATE, PowerMultiplier.ONE );
|
||||
}
|
||||
catch( GridAccessException e )
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
// :P
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ public class PartP2PTunnelME extends PartP2PTunnel<PartP2PTunnelME> implements I
|
||||
public final Connections connection = new Connections( this );
|
||||
final AENetworkProxy outerProxy = new AENetworkProxy( this, "outer", null, true );
|
||||
|
||||
public PartP2PTunnelME( ItemStack is )
|
||||
public PartP2PTunnelME( final ItemStack is )
|
||||
{
|
||||
super( is );
|
||||
this.proxy.setFlags( GridFlags.REQUIRE_CHANNEL, GridFlags.COMPRESSED_CHANNEL );
|
||||
@@ -60,14 +60,14 @@ public class PartP2PTunnelME extends PartP2PTunnel<PartP2PTunnelME> implements I
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT( NBTTagCompound extra )
|
||||
public void readFromNBT( final NBTTagCompound extra )
|
||||
{
|
||||
super.readFromNBT( extra );
|
||||
this.outerProxy.readFromNBT( extra );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT( NBTTagCompound extra )
|
||||
public void writeToNBT( final NBTTagCompound extra )
|
||||
{
|
||||
super.writeToNBT( extra );
|
||||
this.outerProxy.writeToNBT( extra );
|
||||
@@ -83,7 +83,7 @@ public class PartP2PTunnelME extends PartP2PTunnel<PartP2PTunnelME> implements I
|
||||
{
|
||||
this.proxy.getTick().wakeDevice( this.proxy.getNode() );
|
||||
}
|
||||
catch( GridAccessException e )
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
// :P
|
||||
}
|
||||
@@ -91,7 +91,7 @@ public class PartP2PTunnelME extends PartP2PTunnel<PartP2PTunnelME> implements I
|
||||
}
|
||||
|
||||
@Override
|
||||
public AECableType getCableConnectionType( AEPartLocation dir )
|
||||
public AECableType getCableConnectionType( final AEPartLocation dir )
|
||||
{
|
||||
return AECableType.DENSE;
|
||||
}
|
||||
@@ -111,7 +111,7 @@ public class PartP2PTunnelME extends PartP2PTunnel<PartP2PTunnelME> implements I
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPartHostInfo( AEPartLocation side, IPartHost host, TileEntity tile )
|
||||
public void setPartHostInfo( final AEPartLocation side, final IPartHost host, final TileEntity tile )
|
||||
{
|
||||
super.setPartHostInfo( side, host, tile );
|
||||
this.outerProxy.setValidSides( EnumSet.of( side.getFacing() ) );
|
||||
@@ -124,20 +124,20 @@ public class PartP2PTunnelME extends PartP2PTunnel<PartP2PTunnelME> implements I
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlacement( EntityPlayer player, ItemStack held, AEPartLocation side )
|
||||
public void onPlacement( final EntityPlayer player, final ItemStack held, final AEPartLocation side )
|
||||
{
|
||||
super.onPlacement( player, held, side );
|
||||
this.outerProxy.setOwner( player );
|
||||
}
|
||||
|
||||
@Override
|
||||
public TickingRequest getTickingRequest( IGridNode node )
|
||||
public TickingRequest getTickingRequest( final IGridNode node )
|
||||
{
|
||||
return new TickingRequest( TickRates.METunnel.min, TickRates.METunnel.max, true, false );
|
||||
}
|
||||
|
||||
@Override
|
||||
public TickRateModulation tickingRequest( IGridNode node, int ticksSinceLastCall )
|
||||
public TickRateModulation tickingRequest( final IGridNode node, final int ticksSinceLastCall )
|
||||
{
|
||||
// just move on...
|
||||
try
|
||||
@@ -166,7 +166,7 @@ public class PartP2PTunnelME extends PartP2PTunnel<PartP2PTunnelME> implements I
|
||||
return TickRateModulation.SLEEP;
|
||||
}
|
||||
}
|
||||
catch( GridAccessException e )
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
// meh?
|
||||
}
|
||||
@@ -174,11 +174,11 @@ public class PartP2PTunnelME extends PartP2PTunnel<PartP2PTunnelME> implements I
|
||||
return TickRateModulation.IDLE;
|
||||
}
|
||||
|
||||
public void updateConnections( Connections connections )
|
||||
public void updateConnections( final Connections connections )
|
||||
{
|
||||
if( connections.destroy )
|
||||
{
|
||||
for( TunnelConnection cw : this.connection.connections.values() )
|
||||
for( final TunnelConnection cw : this.connection.connections.values() )
|
||||
{
|
||||
cw.c.destroy();
|
||||
}
|
||||
@@ -188,10 +188,10 @@ public class PartP2PTunnelME extends PartP2PTunnel<PartP2PTunnelME> implements I
|
||||
else if( connections.create )
|
||||
{
|
||||
|
||||
Iterator<TunnelConnection> i = this.connection.connections.values().iterator();
|
||||
final Iterator<TunnelConnection> i = this.connection.connections.values().iterator();
|
||||
while( i.hasNext() )
|
||||
{
|
||||
TunnelConnection cw = i.next();
|
||||
final TunnelConnection cw = i.next();
|
||||
try
|
||||
{
|
||||
if( cw.tunnel.proxy.getGrid() != this.proxy.getGrid() )
|
||||
@@ -205,16 +205,16 @@ public class PartP2PTunnelME extends PartP2PTunnel<PartP2PTunnelME> implements I
|
||||
i.remove();
|
||||
}
|
||||
}
|
||||
catch( GridAccessException e )
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
// :P
|
||||
}
|
||||
}
|
||||
|
||||
LinkedList<PartP2PTunnelME> newSides = new LinkedList<PartP2PTunnelME>();
|
||||
final LinkedList<PartP2PTunnelME> newSides = new LinkedList<PartP2PTunnelME>();
|
||||
try
|
||||
{
|
||||
for( PartP2PTunnelME me : this.getOutputs() )
|
||||
for( final PartP2PTunnelME me : this.getOutputs() )
|
||||
{
|
||||
if( me.proxy.isActive() && connections.connections.get( me.getGridNode() ) == null )
|
||||
{
|
||||
@@ -222,13 +222,13 @@ public class PartP2PTunnelME extends PartP2PTunnel<PartP2PTunnelME> implements I
|
||||
}
|
||||
}
|
||||
|
||||
for( PartP2PTunnelME me : newSides )
|
||||
for( final PartP2PTunnelME me : newSides )
|
||||
{
|
||||
try
|
||||
{
|
||||
connections.connections.put( me.getGridNode(), new TunnelConnection( me, AEApi.instance().createGridConnection( this.outerProxy.getNode(), me.outerProxy.getNode() ) ) );
|
||||
}
|
||||
catch( FailedConnection e )
|
||||
catch( final FailedConnection e )
|
||||
{
|
||||
final TileEntity start = this.getTile();
|
||||
final TileEntity end = me.getTile();
|
||||
@@ -239,7 +239,7 @@ public class PartP2PTunnelME extends PartP2PTunnel<PartP2PTunnelME> implements I
|
||||
}
|
||||
}
|
||||
}
|
||||
catch( GridAccessException e )
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
AELog.error( e );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user