final variables and parameters
This commit is contained in:
@@ -126,7 +126,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void PowerEvent( PowerEventType x )
|
||||
protected void PowerEvent( final PowerEventType x )
|
||||
{
|
||||
if( x == PowerEventType.REQUEST_POWER )
|
||||
{
|
||||
@@ -134,7 +134,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan
|
||||
{
|
||||
this.gridProxy.getGrid().postEvent( new MENetworkPowerStorage( this, PowerEventType.REQUEST_POWER ) );
|
||||
}
|
||||
catch( GridAccessException e )
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
// :(
|
||||
}
|
||||
@@ -147,7 +147,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan
|
||||
|
||||
private void recalculateDisplay()
|
||||
{
|
||||
int oldState = this.state;
|
||||
final int oldState = this.state;
|
||||
|
||||
for( int x = 0; x < this.getCellCount(); x++ )
|
||||
{
|
||||
@@ -163,7 +163,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan
|
||||
this.state &= ~0x40;
|
||||
}
|
||||
|
||||
boolean currentActive = this.gridProxy.isActive();
|
||||
final boolean currentActive = this.gridProxy.isActive();
|
||||
if( this.wasActive != currentActive )
|
||||
{
|
||||
this.wasActive = currentActive;
|
||||
@@ -171,7 +171,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan
|
||||
{
|
||||
this.gridProxy.getGrid().postEvent( new MENetworkCellArrayUpdate() );
|
||||
}
|
||||
catch( GridAccessException e )
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
// :P
|
||||
}
|
||||
@@ -189,14 +189,14 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan
|
||||
return 1;
|
||||
}
|
||||
|
||||
public IMEInventoryHandler getHandler( StorageChannel channel ) throws ChestNoHandler
|
||||
public IMEInventoryHandler getHandler( final StorageChannel channel ) throws ChestNoHandler
|
||||
{
|
||||
if( !this.isCached )
|
||||
{
|
||||
this.itemCell = null;
|
||||
this.fluidCell = null;
|
||||
|
||||
ItemStack is = this.inv.getStackInSlot( 1 );
|
||||
final ItemStack is = this.inv.getStackInSlot( 1 );
|
||||
if( is != null )
|
||||
{
|
||||
this.isCached = true;
|
||||
@@ -205,8 +205,8 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan
|
||||
{
|
||||
double power = 1.0;
|
||||
|
||||
IMEInventoryHandler<IAEItemStack> itemCell = this.cellHandler.getCellInventory( is, this, StorageChannel.ITEMS );
|
||||
IMEInventoryHandler<IAEFluidStack> fluidCell = this.cellHandler.getCellInventory( is, this, StorageChannel.FLUIDS );
|
||||
final IMEInventoryHandler<IAEItemStack> itemCell = this.cellHandler.getCellInventory( is, this, StorageChannel.ITEMS );
|
||||
final IMEInventoryHandler<IAEFluidStack> fluidCell = this.cellHandler.getCellInventory( is, this, StorageChannel.FLUIDS );
|
||||
|
||||
if( itemCell != null )
|
||||
{
|
||||
@@ -245,56 +245,56 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan
|
||||
return null;
|
||||
}
|
||||
|
||||
private <StackType extends IAEStack> MEMonitorHandler<StackType> wrap( IMEInventoryHandler h )
|
||||
private <StackType extends IAEStack> MEMonitorHandler<StackType> wrap( final IMEInventoryHandler h )
|
||||
{
|
||||
if( h == null )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
MEInventoryHandler ih = new MEInventoryHandler( h, h.getChannel() );
|
||||
final MEInventoryHandler ih = new MEInventoryHandler( h, h.getChannel() );
|
||||
ih.setPriority( this.priority );
|
||||
|
||||
MEMonitorHandler<StackType> g = new ChestMonitorHandler<StackType>( ih );
|
||||
final MEMonitorHandler<StackType> g = new ChestMonitorHandler<StackType>( ih );
|
||||
g.addListener( new ChestNetNotifier( h.getChannel() ), g );
|
||||
|
||||
return g;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCellStatus( int slot )
|
||||
public int getCellStatus( final int slot )
|
||||
{
|
||||
if( Platform.isClient() )
|
||||
{
|
||||
return ( this.state >> ( slot * 3 ) ) & 3;
|
||||
}
|
||||
|
||||
ItemStack cell = this.inv.getStackInSlot( 1 );
|
||||
ICellHandler ch = AEApi.instance().registries().cell().getHandler( cell );
|
||||
final ItemStack cell = this.inv.getStackInSlot( 1 );
|
||||
final ICellHandler ch = AEApi.instance().registries().cell().getHandler( cell );
|
||||
|
||||
if( ch != null )
|
||||
{
|
||||
try
|
||||
{
|
||||
IMEInventoryHandler handler = this.getHandler( StorageChannel.ITEMS );
|
||||
final IMEInventoryHandler handler = this.getHandler( StorageChannel.ITEMS );
|
||||
if( handler instanceof ChestMonitorHandler )
|
||||
{
|
||||
return ch.getStatusForCell( cell, ( (ChestMonitorHandler) handler ).getInternalHandler() );
|
||||
}
|
||||
}
|
||||
catch( ChestNoHandler ignored )
|
||||
catch( final ChestNoHandler ignored )
|
||||
{
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
IMEInventoryHandler handler = this.getHandler( StorageChannel.FLUIDS );
|
||||
final IMEInventoryHandler handler = this.getHandler( StorageChannel.FLUIDS );
|
||||
if( handler instanceof ChestMonitorHandler )
|
||||
{
|
||||
return ch.getStatusForCell( cell, ( (ChestMonitorHandler) handler ).getInternalHandler() );
|
||||
}
|
||||
}
|
||||
catch( ChestNoHandler ignored )
|
||||
catch( final ChestNoHandler ignored )
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -318,7 +318,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan
|
||||
{
|
||||
gridPowered = this.gridProxy.getEnergy().isNetworkPowered();
|
||||
}
|
||||
catch( GridAccessException ignored )
|
||||
catch( final GridAccessException ignored )
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -327,9 +327,9 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCellBlinking( int slot )
|
||||
public boolean isCellBlinking( final int slot )
|
||||
{
|
||||
long now = this.worldObj.getTotalWorldTime();
|
||||
final long now = this.worldObj.getTotalWorldTime();
|
||||
if( now - this.lastStateChange > 8 )
|
||||
{
|
||||
return false;
|
||||
@@ -339,20 +339,20 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan
|
||||
}
|
||||
|
||||
@Override
|
||||
protected double extractAEPower( double amt, Actionable mode )
|
||||
protected double extractAEPower( final double amt, final Actionable mode )
|
||||
{
|
||||
double stash = 0.0;
|
||||
|
||||
try
|
||||
{
|
||||
IEnergyGrid eg = this.gridProxy.getEnergy();
|
||||
final IEnergyGrid eg = this.gridProxy.getEnergy();
|
||||
stash = eg.extractAEPower( amt, mode, PowerMultiplier.ONE );
|
||||
if( stash >= amt )
|
||||
{
|
||||
return stash;
|
||||
}
|
||||
}
|
||||
catch( GridAccessException e )
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
// no grid :(
|
||||
}
|
||||
@@ -369,22 +369,22 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan
|
||||
return;
|
||||
}
|
||||
|
||||
double idleUsage = this.gridProxy.getIdlePowerUsage();
|
||||
final double idleUsage = this.gridProxy.getIdlePowerUsage();
|
||||
|
||||
try
|
||||
{
|
||||
if( !this.gridProxy.getEnergy().isNetworkPowered() )
|
||||
{
|
||||
double powerUsed = this.extractAEPower( idleUsage, Actionable.MODULATE, PowerMultiplier.CONFIG ); // drain
|
||||
final double powerUsed = this.extractAEPower( idleUsage, Actionable.MODULATE, PowerMultiplier.CONFIG ); // drain
|
||||
if( powerUsed + 0.1 >= idleUsage != ( this.state & 0x40 ) > 0 )
|
||||
{
|
||||
this.recalculateDisplay();
|
||||
}
|
||||
}
|
||||
}
|
||||
catch( GridAccessException e )
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
double powerUsed = this.extractAEPower( this.gridProxy.getIdlePowerUsage(), Actionable.MODULATE, PowerMultiplier.CONFIG ); // drain
|
||||
final double powerUsed = this.extractAEPower( this.gridProxy.getIdlePowerUsage(), Actionable.MODULATE, PowerMultiplier.CONFIG ); // drain
|
||||
if( powerUsed + 0.1 >= idleUsage != ( this.state & 0x40 ) > 0 )
|
||||
{
|
||||
this.recalculateDisplay();
|
||||
@@ -398,7 +398,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan
|
||||
}
|
||||
|
||||
@TileEvent( TileEventType.NETWORK_WRITE )
|
||||
public void writeToStream_TileChest( ByteBuf data )
|
||||
public void writeToStream_TileChest( final ByteBuf data )
|
||||
{
|
||||
if( this.worldObj.getTotalWorldTime() - this.lastStateChange > 8 )
|
||||
{
|
||||
@@ -426,7 +426,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan
|
||||
data.writeByte( this.state );
|
||||
data.writeByte( this.paintedColor.ordinal() );
|
||||
|
||||
ItemStack is = this.inv.getStackInSlot( 1 );
|
||||
final ItemStack is = this.inv.getStackInSlot( 1 );
|
||||
|
||||
if( is == null )
|
||||
{
|
||||
@@ -439,16 +439,16 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan
|
||||
}
|
||||
|
||||
@TileEvent( TileEventType.NETWORK_READ )
|
||||
public boolean readFromStream_TileChest( ByteBuf data )
|
||||
public boolean readFromStream_TileChest( final ByteBuf data )
|
||||
{
|
||||
int oldState = this.state;
|
||||
ItemStack oldType = this.storageType;
|
||||
final int oldState = this.state;
|
||||
final ItemStack oldType = this.storageType;
|
||||
|
||||
this.state = data.readByte();
|
||||
AEColor oldPaintedColor = this.paintedColor;
|
||||
final AEColor oldPaintedColor = this.paintedColor;
|
||||
this.paintedColor = AEColor.values()[data.readByte()];
|
||||
|
||||
int item = data.readInt();
|
||||
final int item = data.readInt();
|
||||
|
||||
if( item == 0 )
|
||||
{
|
||||
@@ -465,7 +465,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan
|
||||
}
|
||||
|
||||
@TileEvent( TileEventType.WORLD_NBT_READ )
|
||||
public void readFromNBT_TileChest( NBTTagCompound data )
|
||||
public void readFromNBT_TileChest( final NBTTagCompound data )
|
||||
{
|
||||
this.config.readFromNBT( data );
|
||||
this.priority = data.getInteger( "priority" );
|
||||
@@ -476,7 +476,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan
|
||||
}
|
||||
|
||||
@TileEvent( TileEventType.WORLD_NBT_WRITE )
|
||||
public void writeToNBT_TileChest( NBTTagCompound data )
|
||||
public void writeToNBT_TileChest( final NBTTagCompound data )
|
||||
{
|
||||
this.config.writeToNBT( data );
|
||||
data.setInteger( "priority", this.priority );
|
||||
@@ -484,13 +484,13 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan
|
||||
}
|
||||
|
||||
@MENetworkEventSubscribe
|
||||
public void powerRender( MENetworkPowerStatusChange c )
|
||||
public void powerRender( final MENetworkPowerStatusChange c )
|
||||
{
|
||||
this.recalculateDisplay();
|
||||
}
|
||||
|
||||
@MENetworkEventSubscribe
|
||||
public void channelRender( MENetworkChannelsChanged c )
|
||||
public void channelRender( final MENetworkChannelsChanged c )
|
||||
{
|
||||
this.recalculateDisplay();
|
||||
}
|
||||
@@ -514,14 +514,14 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInventorySlotContents( int i, ItemStack itemstack )
|
||||
public void setInventorySlotContents( final int i, final ItemStack itemstack )
|
||||
{
|
||||
this.inv.setInventorySlotContents( i, itemstack );
|
||||
this.tryToStoreContents();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removed, ItemStack added )
|
||||
public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removed, final ItemStack added )
|
||||
{
|
||||
if( slot == 1 )
|
||||
{
|
||||
@@ -533,10 +533,10 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan
|
||||
{
|
||||
this.gridProxy.getGrid().postEvent( new MENetworkCellArrayUpdate() );
|
||||
|
||||
IStorageGrid gs = this.gridProxy.getStorage();
|
||||
final IStorageGrid gs = this.gridProxy.getStorage();
|
||||
Platform.postChanges( gs, removed, added, this.mySrc );
|
||||
}
|
||||
catch( GridAccessException ignored )
|
||||
catch( final GridAccessException ignored )
|
||||
{
|
||||
|
||||
}
|
||||
@@ -551,7 +551,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInsertItem( int slotIndex, ItemStack insertingItem, EnumFacing side )
|
||||
public boolean canInsertItem( final int slotIndex, final ItemStack insertingItem, final EnumFacing side )
|
||||
{
|
||||
if( slotIndex == 1 )
|
||||
{
|
||||
@@ -568,11 +568,11 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan
|
||||
{
|
||||
try
|
||||
{
|
||||
IMEInventory<IAEItemStack> cell = this.getHandler( StorageChannel.ITEMS );
|
||||
IAEItemStack returns = cell.injectItems( AEApi.instance().storage().createItemStack( this.inv.getStackInSlot( 0 ) ), Actionable.SIMULATE, this.mySrc );
|
||||
final IMEInventory<IAEItemStack> cell = this.getHandler( StorageChannel.ITEMS );
|
||||
final IAEItemStack returns = cell.injectItems( AEApi.instance().storage().createItemStack( this.inv.getStackInSlot( 0 ) ), Actionable.SIMULATE, this.mySrc );
|
||||
return returns == null || returns.getStackSize() != insertingItem.stackSize;
|
||||
}
|
||||
catch( ChestNoHandler ignored )
|
||||
catch( final ChestNoHandler ignored )
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -580,13 +580,13 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem( int slotIndex, ItemStack extractedItem, EnumFacing side )
|
||||
public boolean canExtractItem( final int slotIndex, final ItemStack extractedItem, final EnumFacing side )
|
||||
{
|
||||
return slotIndex == 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getAccessibleSlotsBySide( EnumFacing side )
|
||||
public int[] getAccessibleSlotsBySide( final EnumFacing side )
|
||||
{
|
||||
if( EnumFacing.SOUTH == side )
|
||||
{
|
||||
@@ -602,7 +602,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan
|
||||
return SIDES;
|
||||
}
|
||||
}
|
||||
catch( ChestNoHandler e )
|
||||
catch( final ChestNoHandler e )
|
||||
{
|
||||
// nope!
|
||||
}
|
||||
@@ -616,9 +616,9 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan
|
||||
{
|
||||
if( this.getStackInSlot( 0 ) != null )
|
||||
{
|
||||
IMEInventory<IAEItemStack> cell = this.getHandler( StorageChannel.ITEMS );
|
||||
final IMEInventory<IAEItemStack> cell = this.getHandler( StorageChannel.ITEMS );
|
||||
|
||||
IAEItemStack returns = Platform.poweredInsert( this, cell, AEApi.instance().storage().createItemStack( this.inv.getStackInSlot( 0 ) ), this.mySrc );
|
||||
final IAEItemStack returns = Platform.poweredInsert( this, cell, AEApi.instance().storage().createItemStack( this.inv.getStackInSlot( 0 ) ), this.mySrc );
|
||||
|
||||
if( returns == null )
|
||||
{
|
||||
@@ -630,13 +630,13 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan
|
||||
}
|
||||
}
|
||||
}
|
||||
catch( ChestNoHandler ignored )
|
||||
catch( final ChestNoHandler ignored )
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IMEInventoryHandler> getCellArray( StorageChannel channel )
|
||||
public List<IMEInventoryHandler> getCellArray( final StorageChannel channel )
|
||||
{
|
||||
if( this.gridProxy.isActive() )
|
||||
{
|
||||
@@ -644,7 +644,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan
|
||||
{
|
||||
return Collections.singletonList( this.getHandler( channel ) );
|
||||
}
|
||||
catch( ChestNoHandler e )
|
||||
catch( final ChestNoHandler e )
|
||||
{
|
||||
// :P
|
||||
}
|
||||
@@ -659,7 +659,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPriority( int newValue )
|
||||
public void setPriority( final int newValue )
|
||||
{
|
||||
this.priority = newValue;
|
||||
|
||||
@@ -671,16 +671,16 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan
|
||||
{
|
||||
this.gridProxy.getGrid().postEvent( new MENetworkCellArrayUpdate() );
|
||||
}
|
||||
catch( GridAccessException e )
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
// :P
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void blinkCell( int slot )
|
||||
public void blinkCell( final int slot )
|
||||
{
|
||||
long now = this.worldObj.getTotalWorldTime();
|
||||
final long now = this.worldObj.getTotalWorldTime();
|
||||
if( now - this.lastStateChange > 8 )
|
||||
{
|
||||
this.state = 0;
|
||||
@@ -693,18 +693,18 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan
|
||||
}
|
||||
|
||||
@Override
|
||||
public int fill( EnumFacing from, FluidStack resource, boolean doFill )
|
||||
public int fill( final EnumFacing from, final FluidStack resource, final boolean doFill )
|
||||
{
|
||||
double req = resource.amount / 500.0;
|
||||
double available = this.extractAEPower( req, Actionable.SIMULATE, PowerMultiplier.CONFIG );
|
||||
final double req = resource.amount / 500.0;
|
||||
final double available = this.extractAEPower( req, Actionable.SIMULATE, PowerMultiplier.CONFIG );
|
||||
if( available >= req - 0.01 )
|
||||
{
|
||||
try
|
||||
{
|
||||
IMEInventoryHandler h = this.getHandler( StorageChannel.FLUIDS );
|
||||
final IMEInventoryHandler h = this.getHandler( StorageChannel.FLUIDS );
|
||||
|
||||
this.extractAEPower( req, Actionable.MODULATE, PowerMultiplier.CONFIG );
|
||||
IAEStack results = h.injectItems( AEFluidStack.create( resource ), doFill ? Actionable.MODULATE : Actionable.SIMULATE, this.mySrc );
|
||||
final IAEStack results = h.injectItems( AEFluidStack.create( resource ), doFill ? Actionable.MODULATE : Actionable.SIMULATE, this.mySrc );
|
||||
|
||||
if( results == null )
|
||||
{
|
||||
@@ -713,7 +713,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan
|
||||
|
||||
return resource.amount - (int) results.getStackSize();
|
||||
}
|
||||
catch( ChestNoHandler ignored )
|
||||
catch( final ChestNoHandler ignored )
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -721,49 +721,49 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan
|
||||
}
|
||||
|
||||
@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 )
|
||||
{
|
||||
try
|
||||
{
|
||||
IMEInventoryHandler h = this.getHandler( StorageChannel.FLUIDS );
|
||||
final IMEInventoryHandler h = this.getHandler( StorageChannel.FLUIDS );
|
||||
return h.canAccept( AEFluidStack.create( new FluidStack( fluid, 1 ) ) );
|
||||
}
|
||||
catch( ChestNoHandler ignored )
|
||||
catch( final ChestNoHandler ignored )
|
||||
{
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@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 )
|
||||
{
|
||||
try
|
||||
{
|
||||
IMEInventoryHandler h = this.getHandler( StorageChannel.FLUIDS );
|
||||
final IMEInventoryHandler h = this.getHandler( StorageChannel.FLUIDS );
|
||||
if( h.getChannel() == StorageChannel.FLUIDS )
|
||||
{
|
||||
return new FluidTankInfo[] { new FluidTankInfo( null, 1 ) }; // eh?
|
||||
}
|
||||
}
|
||||
catch( ChestNoHandler ignored )
|
||||
catch( final ChestNoHandler ignored )
|
||||
{
|
||||
}
|
||||
|
||||
@@ -771,7 +771,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan
|
||||
}
|
||||
|
||||
@Override
|
||||
public IStorageMonitorable getMonitorable( EnumFacing side, BaseActionSource src )
|
||||
public IStorageMonitorable getMonitorable( final EnumFacing side, final BaseActionSource src )
|
||||
{
|
||||
if( Platform.canAccess( this.gridProxy, src ) && side != this.getForward() )
|
||||
{
|
||||
@@ -796,37 +796,37 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateSetting( IConfigManager manager, Enum settingName, Enum newValue )
|
||||
public void updateSetting( final IConfigManager manager, final Enum settingName, final Enum newValue )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public boolean openGui( EntityPlayer p, ICellHandler ch, ItemStack cell, EnumFacing side )
|
||||
public boolean openGui( final EntityPlayer p, final ICellHandler ch, final ItemStack cell, final EnumFacing side )
|
||||
{
|
||||
try
|
||||
{
|
||||
IMEInventoryHandler invHandler = this.getHandler( StorageChannel.ITEMS );
|
||||
final IMEInventoryHandler invHandler = this.getHandler( StorageChannel.ITEMS );
|
||||
if( ch != null && invHandler != null )
|
||||
{
|
||||
ch.openChestGui( p, this, ch, invHandler, cell, StorageChannel.ITEMS );
|
||||
return true;
|
||||
}
|
||||
}
|
||||
catch( ChestNoHandler e )
|
||||
catch( final ChestNoHandler e )
|
||||
{
|
||||
// :P
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
IMEInventoryHandler invHandler = this.getHandler( StorageChannel.FLUIDS );
|
||||
final IMEInventoryHandler invHandler = this.getHandler( StorageChannel.FLUIDS );
|
||||
if( ch != null && invHandler != null )
|
||||
{
|
||||
ch.openChestGui( p, this, ch, invHandler, cell, StorageChannel.FLUIDS );
|
||||
return true;
|
||||
}
|
||||
}
|
||||
catch( ChestNoHandler e )
|
||||
catch( final ChestNoHandler e )
|
||||
{
|
||||
// :P
|
||||
}
|
||||
@@ -842,9 +842,9 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan
|
||||
|
||||
@Override
|
||||
public boolean recolourBlock(
|
||||
EnumFacing side,
|
||||
AEColor newPaintedColor,
|
||||
EntityPlayer who )
|
||||
final EnumFacing side,
|
||||
final AEColor newPaintedColor,
|
||||
final EntityPlayer who )
|
||||
{
|
||||
if( this.paintedColor == newPaintedColor )
|
||||
{
|
||||
@@ -858,7 +858,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveChanges( IMEInventory cellInventory )
|
||||
public void saveChanges( final IMEInventory cellInventory )
|
||||
{
|
||||
this.worldObj.markChunkDirty( pos, this );
|
||||
}
|
||||
@@ -874,13 +874,13 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan
|
||||
|
||||
final StorageChannel chan;
|
||||
|
||||
public ChestNetNotifier( StorageChannel chan )
|
||||
public ChestNetNotifier( final StorageChannel chan )
|
||||
{
|
||||
this.chan = chan;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid( Object verificationToken )
|
||||
public boolean isValid( final Object verificationToken )
|
||||
{
|
||||
if( this.chan == StorageChannel.ITEMS )
|
||||
{
|
||||
@@ -894,7 +894,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postChange( IBaseMonitor<T> monitor, Iterable<T> change, BaseActionSource source )
|
||||
public void postChange( final IBaseMonitor<T> monitor, final Iterable<T> change, final BaseActionSource source )
|
||||
{
|
||||
if( source == TileChest.this.mySrc || ( source instanceof PlayerSource && ( (PlayerSource) source ).via == TileChest.this ) )
|
||||
{
|
||||
@@ -905,7 +905,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan
|
||||
TileChest.this.gridProxy.getStorage().postAlterationOfStoredItems( this.chan, change, TileChest.this.mySrc );
|
||||
}
|
||||
}
|
||||
catch( GridAccessException e )
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
// :(
|
||||
}
|
||||
@@ -925,14 +925,14 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan
|
||||
class ChestMonitorHandler<T extends IAEStack> extends MEMonitorHandler<T>
|
||||
{
|
||||
|
||||
public ChestMonitorHandler( IMEInventoryHandler<T> t )
|
||||
public ChestMonitorHandler( final IMEInventoryHandler<T> t )
|
||||
{
|
||||
super( t );
|
||||
}
|
||||
|
||||
public IMEInventoryHandler<T> getInternalHandler()
|
||||
{
|
||||
IMEInventoryHandler<T> h = this.getHandler();
|
||||
final IMEInventoryHandler<T> h = this.getHandler();
|
||||
if( h instanceof MEInventoryHandler )
|
||||
{
|
||||
return (IMEInventoryHandler<T>) ( (MEInventoryHandler) h ).getInternal();
|
||||
@@ -941,7 +941,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan
|
||||
}
|
||||
|
||||
@Override
|
||||
public T injectItems( T input, Actionable mode, BaseActionSource src )
|
||||
public T injectItems( final T input, final Actionable mode, final BaseActionSource src )
|
||||
{
|
||||
if( src.isPlayer() && !this.securityCheck( ( (PlayerSource) src ).player, SecurityPermissions.INJECT ) )
|
||||
{
|
||||
@@ -950,28 +950,28 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan
|
||||
return super.injectItems( input, mode, src );
|
||||
}
|
||||
|
||||
private boolean securityCheck( EntityPlayer player, SecurityPermissions requiredPermission )
|
||||
private boolean securityCheck( final EntityPlayer player, final SecurityPermissions requiredPermission )
|
||||
{
|
||||
if( TileChest.this.getTile() instanceof IActionHost && requiredPermission != null )
|
||||
{
|
||||
|
||||
IGridNode gn = ( (IActionHost) TileChest.this.getTile() ).getActionableNode();
|
||||
final IGridNode gn = ( (IActionHost) TileChest.this.getTile() ).getActionableNode();
|
||||
if( gn != null )
|
||||
{
|
||||
IGrid g = gn.getGrid();
|
||||
final IGrid g = gn.getGrid();
|
||||
if( g != null )
|
||||
{
|
||||
boolean requirePower = false;
|
||||
final boolean requirePower = false;
|
||||
if( requirePower )
|
||||
{
|
||||
IEnergyGrid eg = g.getCache( IEnergyGrid.class );
|
||||
final IEnergyGrid eg = g.getCache( IEnergyGrid.class );
|
||||
if( !eg.isNetworkPowered() )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
ISecurityGrid sg = g.getCache( ISecurityGrid.class );
|
||||
final ISecurityGrid sg = g.getCache( ISecurityGrid.class );
|
||||
if( sg.hasPermission( player, requiredPermission ) )
|
||||
{
|
||||
return true;
|
||||
@@ -985,7 +985,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan
|
||||
}
|
||||
|
||||
@Override
|
||||
public T extractItems( T request, Actionable mode, BaseActionSource src )
|
||||
public T extractItems( final T request, final Actionable mode, final BaseActionSource src )
|
||||
{
|
||||
if( src.isPlayer() && !this.securityCheck( ( (PlayerSource) src ).player, SecurityPermissions.EXTRACT ) )
|
||||
{
|
||||
|
||||
@@ -82,7 +82,7 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior
|
||||
}
|
||||
|
||||
@TileEvent( TileEventType.NETWORK_WRITE )
|
||||
public void writeToStream_TileDrive( ByteBuf data )
|
||||
public void writeToStream_TileDrive( final ByteBuf data )
|
||||
{
|
||||
if( this.worldObj.getTotalWorldTime() - this.lastStateChange > 8 )
|
||||
{
|
||||
@@ -117,17 +117,17 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCellStatus( int slot )
|
||||
public int getCellStatus( final int slot )
|
||||
{
|
||||
if( Platform.isClient() )
|
||||
{
|
||||
return ( this.state >> ( slot * 3 ) ) & 3;
|
||||
}
|
||||
|
||||
ItemStack cell = this.inv.getStackInSlot( 2 );
|
||||
ICellHandler ch = this.handlersBySlot[slot];
|
||||
final ItemStack cell = this.inv.getStackInSlot( 2 );
|
||||
final ICellHandler ch = this.handlersBySlot[slot];
|
||||
|
||||
MEInventoryHandler handler = this.invBySlot[slot];
|
||||
final MEInventoryHandler handler = this.invBySlot[slot];
|
||||
if( handler == null )
|
||||
{
|
||||
return 0;
|
||||
@@ -164,9 +164,9 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCellBlinking( int slot )
|
||||
public boolean isCellBlinking( final int slot )
|
||||
{
|
||||
long now = this.worldObj.getTotalWorldTime();
|
||||
final long now = this.worldObj.getTotalWorldTime();
|
||||
if( now - this.lastStateChange > 8 )
|
||||
{
|
||||
return false;
|
||||
@@ -176,29 +176,29 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior
|
||||
}
|
||||
|
||||
@TileEvent( TileEventType.NETWORK_READ )
|
||||
public boolean readFromStream_TileDrive( ByteBuf data )
|
||||
public boolean readFromStream_TileDrive( final ByteBuf data )
|
||||
{
|
||||
int oldState = this.state;
|
||||
final int oldState = this.state;
|
||||
this.state = data.readInt();
|
||||
this.lastStateChange = this.worldObj.getTotalWorldTime();
|
||||
return ( this.state & 0xDB6DB6DB ) != ( oldState & 0xDB6DB6DB );
|
||||
}
|
||||
|
||||
@TileEvent( TileEventType.WORLD_NBT_READ )
|
||||
public void readFromNBT_TileDrive( NBTTagCompound data )
|
||||
public void readFromNBT_TileDrive( final NBTTagCompound data )
|
||||
{
|
||||
this.isCached = false;
|
||||
this.priority = data.getInteger( "priority" );
|
||||
}
|
||||
|
||||
@TileEvent( TileEventType.WORLD_NBT_WRITE )
|
||||
public void writeToNBT_TileDrive( NBTTagCompound data )
|
||||
public void writeToNBT_TileDrive( final NBTTagCompound data )
|
||||
{
|
||||
data.setInteger( "priority", this.priority );
|
||||
}
|
||||
|
||||
@MENetworkEventSubscribe
|
||||
public void powerRender( MENetworkPowerStatusChange c )
|
||||
public void powerRender( final MENetworkPowerStatusChange c )
|
||||
{
|
||||
this.recalculateDisplay();
|
||||
}
|
||||
@@ -206,7 +206,7 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior
|
||||
private void recalculateDisplay()
|
||||
{
|
||||
|
||||
boolean currentActive = this.gridProxy.isActive();
|
||||
final boolean currentActive = this.gridProxy.isActive();
|
||||
if( currentActive )
|
||||
{
|
||||
this.state |= 0x80000000;
|
||||
@@ -223,7 +223,7 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior
|
||||
{
|
||||
this.gridProxy.getGrid().postEvent( new MENetworkCellArrayUpdate() );
|
||||
}
|
||||
catch( GridAccessException e )
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
// :P
|
||||
}
|
||||
@@ -234,7 +234,7 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior
|
||||
this.state |= ( this.getCellStatus( x ) << ( 3 * x ) );
|
||||
}
|
||||
|
||||
int oldState = 0;
|
||||
final int oldState = 0;
|
||||
if( oldState != this.state )
|
||||
{
|
||||
this.markForUpdate();
|
||||
@@ -242,13 +242,13 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior
|
||||
}
|
||||
|
||||
@MENetworkEventSubscribe
|
||||
public void channelRender( MENetworkChannelsChanged c )
|
||||
public void channelRender( final MENetworkChannelsChanged c )
|
||||
{
|
||||
this.recalculateDisplay();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AECableType getCableConnectionType( AEPartLocation dir )
|
||||
public AECableType getCableConnectionType( final AEPartLocation dir )
|
||||
{
|
||||
return AECableType.SMART;
|
||||
}
|
||||
@@ -266,13 +266,13 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot( int i, ItemStack itemstack )
|
||||
public boolean isItemValidForSlot( final int i, final ItemStack itemstack )
|
||||
{
|
||||
return itemstack != null && AEApi.instance().registries().cell().isCellHandled( itemstack );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removed, ItemStack added )
|
||||
public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removed, final ItemStack added )
|
||||
{
|
||||
if( this.isCached )
|
||||
{
|
||||
@@ -284,10 +284,10 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior
|
||||
{
|
||||
this.gridProxy.getGrid().postEvent( new MENetworkCellArrayUpdate() );
|
||||
|
||||
IStorageGrid gs = this.gridProxy.getStorage();
|
||||
final IStorageGrid gs = this.gridProxy.getStorage();
|
||||
Platform.postChanges( gs, removed, added, this.mySrc );
|
||||
}
|
||||
catch( GridAccessException ignored )
|
||||
catch( final GridAccessException ignored )
|
||||
{
|
||||
}
|
||||
|
||||
@@ -295,7 +295,7 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getAccessibleSlotsBySide( EnumFacing side )
|
||||
public int[] getAccessibleSlotsBySide( final EnumFacing side )
|
||||
{
|
||||
return this.sides;
|
||||
}
|
||||
@@ -311,7 +311,7 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior
|
||||
|
||||
for( int x = 0; x < this.inv.getSizeInventory(); x++ )
|
||||
{
|
||||
ItemStack is = this.inv.getStackInSlot( x );
|
||||
final ItemStack is = this.inv.getStackInSlot( x );
|
||||
this.invBySlot[x] = null;
|
||||
this.handlersBySlot[x] = null;
|
||||
|
||||
@@ -327,7 +327,7 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior
|
||||
{
|
||||
power += this.handlersBySlot[x].cellIdleDrain( is, cell );
|
||||
|
||||
DriveWatcher<IAEItemStack> ih = new DriveWatcher( cell, is, this.handlersBySlot[x], this );
|
||||
final DriveWatcher<IAEItemStack> ih = new DriveWatcher( cell, is, this.handlersBySlot[x], this );
|
||||
ih.setPriority( this.priority );
|
||||
this.invBySlot[x] = ih;
|
||||
this.items.add( ih );
|
||||
@@ -340,7 +340,7 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior
|
||||
{
|
||||
power += this.handlersBySlot[x].cellIdleDrain( is, cell );
|
||||
|
||||
DriveWatcher<IAEItemStack> ih = new DriveWatcher( cell, is, this.handlersBySlot[x], this );
|
||||
final DriveWatcher<IAEItemStack> ih = new DriveWatcher( cell, is, this.handlersBySlot[x], this );
|
||||
ih.setPriority( this.priority );
|
||||
this.invBySlot[x] = ih;
|
||||
this.fluids.add( ih );
|
||||
@@ -364,7 +364,7 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IMEInventoryHandler> getCellArray( StorageChannel channel )
|
||||
public List<IMEInventoryHandler> getCellArray( final StorageChannel channel )
|
||||
{
|
||||
if( this.gridProxy.isActive() )
|
||||
{
|
||||
@@ -381,7 +381,7 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPriority( int newValue )
|
||||
public void setPriority( final int newValue )
|
||||
{
|
||||
this.priority = newValue;
|
||||
this.markDirty();
|
||||
@@ -393,16 +393,16 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior
|
||||
{
|
||||
this.gridProxy.getGrid().postEvent( new MENetworkCellArrayUpdate() );
|
||||
}
|
||||
catch( GridAccessException e )
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
// :P
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void blinkCell( int slot )
|
||||
public void blinkCell( final int slot )
|
||||
{
|
||||
long now = this.worldObj.getTotalWorldTime();
|
||||
final long now = this.worldObj.getTotalWorldTime();
|
||||
if( now - this.lastStateChange > 8 )
|
||||
{
|
||||
this.state = 0;
|
||||
@@ -415,7 +415,7 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveChanges( IMEInventory cellInventory )
|
||||
public void saveChanges( final IMEInventory cellInventory )
|
||||
{
|
||||
this.worldObj.markChunkDirty( pos, this );
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC
|
||||
}
|
||||
|
||||
@TileEvent( TileEventType.WORLD_NBT_WRITE )
|
||||
public void writeToNBT_TileIOPort( NBTTagCompound data )
|
||||
public void writeToNBT_TileIOPort( final NBTTagCompound data )
|
||||
{
|
||||
this.manager.writeToNBT( data );
|
||||
this.cells.writeToNBT( data, "cells" );
|
||||
@@ -130,7 +130,7 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC
|
||||
}
|
||||
|
||||
@TileEvent( TileEventType.WORLD_NBT_READ )
|
||||
public void readFromNBT_TileIOPort( NBTTagCompound data )
|
||||
public void readFromNBT_TileIOPort( final NBTTagCompound data )
|
||||
{
|
||||
this.manager.readFromNBT( data );
|
||||
this.cells.readFromNBT( data, "cells" );
|
||||
@@ -142,7 +142,7 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC
|
||||
}
|
||||
|
||||
@Override
|
||||
public AECableType getCableConnectionType( AEPartLocation dir )
|
||||
public AECableType getCableConnectionType( final AEPartLocation dir )
|
||||
{
|
||||
return AECableType.SMART;
|
||||
}
|
||||
@@ -166,7 +166,7 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC
|
||||
this.gridProxy.getTick().sleepDevice( this.gridProxy.getNode() );
|
||||
}
|
||||
}
|
||||
catch( GridAccessException e )
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
// :P
|
||||
}
|
||||
@@ -174,7 +174,7 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC
|
||||
|
||||
public void updateRedstoneState()
|
||||
{
|
||||
YesNo currentState = this.worldObj.isBlockIndirectlyGettingPowered( pos ) != 0 ? YesNo.YES : YesNo.NO;
|
||||
final YesNo currentState = this.worldObj.isBlockIndirectlyGettingPowered( pos ) != 0 ? YesNo.YES : YesNo.NO;
|
||||
if( this.lastRedstoneState != currentState )
|
||||
{
|
||||
this.lastRedstoneState = currentState;
|
||||
@@ -199,7 +199,7 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC
|
||||
return true;
|
||||
}
|
||||
|
||||
RedstoneMode rs = (RedstoneMode) this.manager.getSetting( Settings.REDSTONE_CONTROLLED );
|
||||
final RedstoneMode rs = (RedstoneMode) this.manager.getSetting( Settings.REDSTONE_CONTROLLED );
|
||||
if( rs == RedstoneMode.HIGH_SIGNAL )
|
||||
{
|
||||
return this.getRedstoneState();
|
||||
@@ -214,7 +214,7 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC
|
||||
}
|
||||
|
||||
@Override
|
||||
public IInventory getInventoryByName( String name )
|
||||
public IInventory getInventoryByName( final String name )
|
||||
{
|
||||
if( name.equals( "upgrades" ) )
|
||||
{
|
||||
@@ -230,7 +230,7 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateSetting( IConfigManager manager, Enum settingName, Enum newValue )
|
||||
public void updateSetting( final IConfigManager manager, final Enum settingName, final Enum newValue )
|
||||
{
|
||||
this.updateTask();
|
||||
}
|
||||
@@ -258,7 +258,7 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removed, ItemStack added )
|
||||
public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removed, final ItemStack added )
|
||||
{
|
||||
if( this.cells == inv )
|
||||
{
|
||||
@@ -267,9 +267,9 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInsertItem( int slotIndex, ItemStack insertingItem, EnumFacing side )
|
||||
public boolean canInsertItem( final int slotIndex, final ItemStack insertingItem, final EnumFacing side )
|
||||
{
|
||||
for( int inputSlotIndex : this.input )
|
||||
for( final int inputSlotIndex : this.input )
|
||||
{
|
||||
if( inputSlotIndex == slotIndex )
|
||||
{
|
||||
@@ -281,9 +281,9 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem( int slotIndex, ItemStack extractedItem, EnumFacing side )
|
||||
public boolean canExtractItem( final int slotIndex, final ItemStack extractedItem, final EnumFacing side )
|
||||
{
|
||||
for( int outputSlotIndex : this.output )
|
||||
for( final int outputSlotIndex : this.output )
|
||||
{
|
||||
if( outputSlotIndex == slotIndex )
|
||||
{
|
||||
@@ -295,7 +295,7 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getAccessibleSlotsBySide( EnumFacing d )
|
||||
public int[] getAccessibleSlotsBySide( final EnumFacing d )
|
||||
{
|
||||
if( d == EnumFacing.UP || d == EnumFacing.DOWN )
|
||||
{
|
||||
@@ -306,13 +306,13 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC
|
||||
}
|
||||
|
||||
@Override
|
||||
public TickingRequest getTickingRequest( IGridNode node )
|
||||
public TickingRequest getTickingRequest( final IGridNode node )
|
||||
{
|
||||
return new TickingRequest( TickRates.IOPort.min, TickRates.IOPort.max, this.hasWork(), false );
|
||||
}
|
||||
|
||||
@Override
|
||||
public TickRateModulation tickingRequest( IGridNode node, int ticksSinceLastCall )
|
||||
public TickRateModulation tickingRequest( final IGridNode node, final int ticksSinceLastCall )
|
||||
{
|
||||
if( !this.gridProxy.isActive() )
|
||||
{
|
||||
@@ -336,18 +336,18 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC
|
||||
|
||||
try
|
||||
{
|
||||
IMEInventory<IAEItemStack> itemNet = this.gridProxy.getStorage().getItemInventory();
|
||||
IMEInventory<IAEFluidStack> fluidNet = this.gridProxy.getStorage().getFluidInventory();
|
||||
IEnergySource energy = this.gridProxy.getEnergy();
|
||||
final IMEInventory<IAEItemStack> itemNet = this.gridProxy.getStorage().getItemInventory();
|
||||
final IMEInventory<IAEFluidStack> fluidNet = this.gridProxy.getStorage().getFluidInventory();
|
||||
final IEnergySource energy = this.gridProxy.getEnergy();
|
||||
for( int x = 0; x < 6; x++ )
|
||||
{
|
||||
ItemStack is = this.cells.getStackInSlot( x );
|
||||
final ItemStack is = this.cells.getStackInSlot( x );
|
||||
if( is != null )
|
||||
{
|
||||
if( ItemsToMove > 0 )
|
||||
{
|
||||
IMEInventory<IAEItemStack> itemInv = this.getInv( is, StorageChannel.ITEMS );
|
||||
IMEInventory<IAEFluidStack> fluidInv = this.getInv( is, StorageChannel.FLUIDS );
|
||||
final IMEInventory<IAEItemStack> itemInv = this.getInv( is, StorageChannel.ITEMS );
|
||||
final IMEInventory<IAEFluidStack> fluidInv = this.getInv( is, StorageChannel.FLUIDS );
|
||||
|
||||
if( this.manager.getSetting( Settings.OPERATION_MODE ) == OperationMode.EMPTY )
|
||||
{
|
||||
@@ -386,7 +386,7 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC
|
||||
}
|
||||
}
|
||||
}
|
||||
catch( GridAccessException e )
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
return TickRateModulation.IDLE;
|
||||
}
|
||||
@@ -396,12 +396,12 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInstalledUpgrades( Upgrades u )
|
||||
public int getInstalledUpgrades( final Upgrades u )
|
||||
{
|
||||
return this.upgrades.getInstalledUpgrades( u );
|
||||
}
|
||||
|
||||
private IMEInventory getInv( ItemStack is, StorageChannel chan )
|
||||
private IMEInventory getInv( final ItemStack is, final StorageChannel chan )
|
||||
{
|
||||
if( this.currentCell != is )
|
||||
{
|
||||
@@ -418,9 +418,9 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC
|
||||
return this.cachedFluid;
|
||||
}
|
||||
|
||||
private long transferContents( IEnergySource energy, IMEInventory src, IMEInventory destination, long itemsToMove, StorageChannel chan )
|
||||
private long transferContents( final IEnergySource energy, final IMEInventory src, final IMEInventory destination, long itemsToMove, final StorageChannel chan )
|
||||
{
|
||||
IItemList<? extends IAEStack> myList;
|
||||
final IItemList<? extends IAEStack> myList;
|
||||
if( src instanceof IMEMonitor )
|
||||
{
|
||||
myList = ( (IMEMonitor) src ).getStorageList();
|
||||
@@ -436,12 +436,12 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC
|
||||
{
|
||||
didStuff = false;
|
||||
|
||||
for( IAEStack s : myList )
|
||||
for( final IAEStack s : myList )
|
||||
{
|
||||
long totalStackSize = s.getStackSize();
|
||||
final long totalStackSize = s.getStackSize();
|
||||
if( totalStackSize > 0 )
|
||||
{
|
||||
IAEStack stack = destination.injectItems( s, Actionable.SIMULATE, this.mySrc );
|
||||
final IAEStack stack = destination.injectItems( s, Actionable.SIMULATE, this.mySrc );
|
||||
|
||||
long possible = 0;
|
||||
if( stack == null )
|
||||
@@ -458,11 +458,11 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC
|
||||
possible = Math.min( possible, itemsToMove );
|
||||
s.setStackSize( possible );
|
||||
|
||||
IAEStack extracted = src.extractItems( s, Actionable.MODULATE, this.mySrc );
|
||||
final IAEStack extracted = src.extractItems( s, Actionable.MODULATE, this.mySrc );
|
||||
if( extracted != null )
|
||||
{
|
||||
possible = extracted.getStackSize();
|
||||
IAEStack failed = Platform.poweredInsert( energy, destination, extracted, this.mySrc );
|
||||
final IAEStack failed = Platform.poweredInsert( energy, destination, extracted, this.mySrc );
|
||||
|
||||
if( failed != null )
|
||||
{
|
||||
@@ -487,9 +487,9 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC
|
||||
return itemsToMove;
|
||||
}
|
||||
|
||||
private boolean shouldMove( IMEInventory<IAEItemStack> itemInv, IMEInventory<IAEFluidStack> fluidInv )
|
||||
private boolean shouldMove( final IMEInventory<IAEItemStack> itemInv, final IMEInventory<IAEFluidStack> fluidInv )
|
||||
{
|
||||
FullnessMode fm = (FullnessMode) this.manager.getSetting( Settings.FULLNESS_MODE );
|
||||
final FullnessMode fm = (FullnessMode) this.manager.getSetting( Settings.FULLNESS_MODE );
|
||||
|
||||
if( itemInv != null && fluidInv != null )
|
||||
{
|
||||
@@ -507,10 +507,10 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean moveSlot( int x )
|
||||
private boolean moveSlot( final int x )
|
||||
{
|
||||
WrapperInventoryRange wir = new WrapperInventoryRange( this, this.output, true );
|
||||
ItemStack result = InventoryAdaptor.getAdaptor( wir, EnumFacing.UP ).addItems( this.getStackInSlot( x ) );
|
||||
final WrapperInventoryRange wir = new WrapperInventoryRange( this, this.output, true );
|
||||
final ItemStack result = InventoryAdaptor.getAdaptor( wir, EnumFacing.UP ).addItems( this.getStackInSlot( x ) );
|
||||
|
||||
if( result == null )
|
||||
{
|
||||
@@ -521,14 +521,14 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean matches( FullnessMode fm, IMEInventory src )
|
||||
private boolean matches( final FullnessMode fm, final IMEInventory src )
|
||||
{
|
||||
if( fm == FullnessMode.HALF )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
IItemList<? extends IAEStack> myList;
|
||||
final IItemList<? extends IAEStack> myList;
|
||||
|
||||
if( src instanceof IMEMonitor )
|
||||
{
|
||||
@@ -544,7 +544,7 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC
|
||||
return myList.isEmpty();
|
||||
}
|
||||
|
||||
IAEStack test = myList.getFirstItem();
|
||||
final IAEStack test = myList.getFirstItem();
|
||||
if( test != null )
|
||||
{
|
||||
test.setStackSize( 1 );
|
||||
@@ -564,15 +564,15 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC
|
||||
*/
|
||||
@Override
|
||||
public void getDrops(
|
||||
World w,
|
||||
BlockPos pos,
|
||||
List<ItemStack> drops )
|
||||
final World w,
|
||||
final BlockPos pos,
|
||||
final List<ItemStack> drops )
|
||||
{
|
||||
super.getDrops( w, pos, drops );
|
||||
|
||||
for( int upgradeIndex = 0; upgradeIndex < this.upgrades.getSizeInventory(); upgradeIndex++ )
|
||||
{
|
||||
ItemStack stackInSlot = this.upgrades.getStackInSlot( upgradeIndex );
|
||||
final ItemStack stackInSlot = this.upgrades.getStackInSlot( upgradeIndex );
|
||||
|
||||
if( stackInSlot != null )
|
||||
{
|
||||
|
||||
@@ -44,15 +44,15 @@ public class TileSkyChest extends AEBaseInvTile
|
||||
public float lidAngle;
|
||||
|
||||
@TileEvent( TileEventType.NETWORK_WRITE )
|
||||
public void writeToStream_TileSkyChest( ByteBuf data )
|
||||
public void writeToStream_TileSkyChest( final ByteBuf data )
|
||||
{
|
||||
data.writeBoolean( this.playerOpen > 0 );
|
||||
}
|
||||
|
||||
@TileEvent( TileEventType.NETWORK_READ )
|
||||
public boolean readFromStream_TileSkyChest( ByteBuf data )
|
||||
public boolean readFromStream_TileSkyChest( final ByteBuf data )
|
||||
{
|
||||
int wasOpen = this.playerOpen;
|
||||
final int wasOpen = this.playerOpen;
|
||||
this.playerOpen = data.readBoolean() ? 1 : 0;
|
||||
|
||||
if( wasOpen != this.playerOpen )
|
||||
@@ -76,7 +76,7 @@ public class TileSkyChest extends AEBaseInvTile
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openInventory( EntityPlayer player )
|
||||
public void openInventory( final EntityPlayer player )
|
||||
{
|
||||
if( Platform.isClient() )
|
||||
{
|
||||
@@ -93,7 +93,7 @@ public class TileSkyChest extends AEBaseInvTile
|
||||
}
|
||||
|
||||
@Override
|
||||
public void closeInventory( EntityPlayer player )
|
||||
public void closeInventory( final EntityPlayer player )
|
||||
{
|
||||
if( Platform.isClient() )
|
||||
{
|
||||
@@ -115,13 +115,13 @@ public class TileSkyChest extends AEBaseInvTile
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removed, ItemStack added )
|
||||
public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removed, final ItemStack added )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getAccessibleSlotsBySide( EnumFacing side )
|
||||
public int[] getAccessibleSlotsBySide( final EnumFacing side )
|
||||
{
|
||||
return this.sides;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user