final variables and parameters

This commit is contained in:
thatsIch
2015-09-30 14:24:40 +02:00
parent 059523f543
commit 8b3a954f73
732 changed files with 9253 additions and 9256 deletions
@@ -64,19 +64,19 @@ public class TileCellWorkbench extends AEBaseTile implements IUpgradeableHost, I
{
if( this.cacheUpgrades == null )
{
ICellWorkbenchItem cell = this.getCell();
final ICellWorkbenchItem cell = this.getCell();
if( cell == null )
{
return null;
}
ItemStack is = this.cell.getStackInSlot( 0 );
final ItemStack is = this.cell.getStackInSlot( 0 );
if( is == null )
{
return null;
}
IInventory inv = cell.getUpgradesInventory( is );
final IInventory inv = cell.getUpgradesInventory( is );
if( inv == null )
{
return null;
@@ -103,7 +103,7 @@ public class TileCellWorkbench extends AEBaseTile implements IUpgradeableHost, I
}
@TileEvent( TileEventType.WORLD_NBT_WRITE )
public void writeToNBT_TileCellWorkbench( NBTTagCompound data )
public void writeToNBT_TileCellWorkbench( final NBTTagCompound data )
{
this.cell.writeToNBT( data, "cell" );
this.config.writeToNBT( data, "config" );
@@ -111,7 +111,7 @@ public class TileCellWorkbench extends AEBaseTile implements IUpgradeableHost, I
}
@TileEvent( TileEventType.WORLD_NBT_READ )
public void readFromNBT_TileCellWorkbench( NBTTagCompound data )
public void readFromNBT_TileCellWorkbench( final NBTTagCompound data )
{
this.cell.readFromNBT( data, "cell" );
this.config.readFromNBT( data, "config" );
@@ -119,7 +119,7 @@ public class TileCellWorkbench extends AEBaseTile implements IUpgradeableHost, I
}
@Override
public IInventory getInventoryByName( String name )
public IInventory getInventoryByName( final String name )
{
if( name.equals( "config" ) )
{
@@ -135,13 +135,13 @@ public class TileCellWorkbench extends AEBaseTile implements IUpgradeableHost, I
}
@Override
public int getInstalledUpgrades( Upgrades u )
public int getInstalledUpgrades( final Upgrades u )
{
return 0;
}
@Override
public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removedStack, ItemStack newStack )
public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removedStack, final ItemStack newStack )
{
if( inv == this.cell && !this.locked )
{
@@ -150,7 +150,7 @@ public class TileCellWorkbench extends AEBaseTile implements IUpgradeableHost, I
this.cacheUpgrades = null;
this.cacheConfig = null;
IInventory configInventory = this.getCellConfigInventory();
final IInventory configInventory = this.getCellConfigInventory();
if( configInventory != null )
{
boolean cellHasConfig = false;
@@ -194,7 +194,7 @@ public class TileCellWorkbench extends AEBaseTile implements IUpgradeableHost, I
}
else if( inv == this.config && !this.locked )
{
IInventory c = this.getCellConfigInventory();
final IInventory c = this.getCellConfigInventory();
if( c != null )
{
for( int x = 0; x < this.config.getSizeInventory(); x++ )
@@ -211,19 +211,19 @@ public class TileCellWorkbench extends AEBaseTile implements IUpgradeableHost, I
{
if( this.cacheConfig == null )
{
ICellWorkbenchItem cell = this.getCell();
final ICellWorkbenchItem cell = this.getCell();
if( cell == null )
{
return null;
}
ItemStack is = this.cell.getStackInSlot( 0 );
final ItemStack is = this.cell.getStackInSlot( 0 );
if( is == null )
{
return null;
}
IInventory inv = cell.getConfigInventory( is );
final IInventory inv = cell.getConfigInventory( is );
if( inv == null )
{
return null;
@@ -236,9 +236,9 @@ public class TileCellWorkbench extends AEBaseTile implements IUpgradeableHost, I
@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 );
@@ -255,7 +255,7 @@ public class TileCellWorkbench extends AEBaseTile implements IUpgradeableHost, I
}
@Override
public void updateSetting( IConfigManager manager, Enum settingName, Enum newValue )
public void updateSetting( final IConfigManager manager, final Enum settingName, final Enum newValue )
{
// nothing here..
}
+25 -25
View File
@@ -72,21 +72,21 @@ public class TileCharger extends AENetworkPowerTile implements ICrankable, IUpda
}
@Override
public AECableType getCableConnectionType( AEPartLocation dir )
public AECableType getCableConnectionType( final AEPartLocation dir )
{
return AECableType.COVERED;
}
@TileEvent( TileEventType.NETWORK_READ )
public boolean readFromStream_TileCharger( ByteBuf data )
public boolean readFromStream_TileCharger( final ByteBuf data )
{
try
{
IAEItemStack item = AEItemStack.loadItemStackFromPacket( data );
ItemStack is = item.getItemStack();
final IAEItemStack item = AEItemStack.loadItemStackFromPacket( data );
final ItemStack is = item.getItemStack();
this.inv.setInventorySlotContents( 0, is );
}
catch( Throwable t )
catch( final Throwable t )
{
this.inv.setInventorySlotContents( 0, null );
}
@@ -94,9 +94,9 @@ public class TileCharger extends AENetworkPowerTile implements ICrankable, IUpda
}
@TileEvent( TileEventType.NETWORK_WRITE )
public void writeToStream_TileCharger( ByteBuf data ) throws IOException
public void writeToStream_TileCharger( final ByteBuf data ) throws IOException
{
AEItemStack is = AEItemStack.create( this.getStackInSlot( 0 ) );
final AEItemStack is = AEItemStack.create( this.getStackInSlot( 0 ) );
if( is != null )
{
is.writeToPacket( data );
@@ -121,7 +121,7 @@ public class TileCharger extends AENetworkPowerTile implements ICrankable, IUpda
}
this.tickTickTimer = 0;
ItemStack myItem = this.getStackInSlot( 0 );
final ItemStack myItem = this.getStackInSlot( 0 );
// charge from the network!
if( this.internalCurrentPower < 1499 )
@@ -131,7 +131,7 @@ public class TileCharger extends AENetworkPowerTile implements ICrankable, IUpda
this.injectExternalPower( PowerUnits.AE, this.gridProxy.getEnergy().extractAEPower( Math.min( 150.0, 1500.0 - this.internalCurrentPower ), Actionable.MODULATE, PowerMultiplier.ONE ) );
this.tickTickTimer = 20; // keep ticking...
}
catch( GridAccessException e )
catch( final GridAccessException e )
{
// continue!
}
@@ -146,12 +146,12 @@ public class TileCharger extends AENetworkPowerTile implements ICrankable, IUpda
if( this.internalCurrentPower > 149 && Platform.isChargeable( myItem ) )
{
IAEItemPowerStorage ps = (IAEItemPowerStorage) myItem.getItem();
final IAEItemPowerStorage ps = (IAEItemPowerStorage) myItem.getItem();
if( ps.getAEMaxPower( myItem ) > ps.getAECurrentPower( myItem ) )
{
double oldPower = this.internalCurrentPower;
final double oldPower = this.internalCurrentPower;
double adjustment = ps.injectAEPower( myItem, this.extractAEPower( 150.0, Actionable.MODULATE, PowerMultiplier.CONFIG ) );
final double adjustment = ps.injectAEPower( myItem, this.extractAEPower( 150.0, Actionable.MODULATE, PowerMultiplier.CONFIG ) );
this.internalCurrentPower += adjustment;
if( oldPower > this.internalCurrentPower )
{
@@ -166,7 +166,7 @@ public class TileCharger extends AENetworkPowerTile implements ICrankable, IUpda
{
this.extractAEPower( this.internalMaxPower, Actionable.MODULATE, PowerMultiplier.CONFIG );// 1500
for( ItemStack charged : materials.certusQuartzCrystalCharged().maybeStack( myItem.stackSize ).asSet() )
for( final ItemStack charged : materials.certusQuartzCrystalCharged().maybeStack( myItem.stackSize ).asSet() )
{
this.setInventorySlotContents( 0, charged );
}
@@ -175,7 +175,7 @@ public class TileCharger extends AENetworkPowerTile implements ICrankable, IUpda
}
@Override
public void setOrientation( EnumFacing inForward, EnumFacing inUp )
public void setOrientation( final EnumFacing inForward, final EnumFacing inUp )
{
super.setOrientation( inForward, inUp );
this.gridProxy.setValidSides( EnumSet.of( this.getUp(), this.getUp().getOpposite() ) );
@@ -199,7 +199,7 @@ public class TileCharger extends AENetworkPowerTile implements ICrankable, IUpda
{
this.injectExternalPower( PowerUnits.AE, 150 );
ItemStack myItem = this.getStackInSlot( 0 );
final ItemStack myItem = this.getStackInSlot( 0 );
if( this.internalCurrentPower > 1499 )
{
final IMaterials materials = AEApi.instance().definitions().materials();
@@ -208,7 +208,7 @@ public class TileCharger extends AENetworkPowerTile implements ICrankable, IUpda
{
this.extractAEPower( this.internalMaxPower, Actionable.MODULATE, PowerMultiplier.CONFIG );// 1500
for( ItemStack charged : materials.certusQuartzCrystalCharged().maybeStack( myItem.stackSize ).asSet() )
for( final ItemStack charged : materials.certusQuartzCrystalCharged().maybeStack( myItem.stackSize ).asSet() )
{
this.setInventorySlotContents( 0, charged );
}
@@ -217,7 +217,7 @@ public class TileCharger extends AENetworkPowerTile implements ICrankable, IUpda
}
@Override
public boolean canCrankAttach( EnumFacing directionToCrank )
public boolean canCrankAttach( final EnumFacing directionToCrank )
{
return this.getUp() == directionToCrank || this.getUp().getOpposite() == directionToCrank;
}
@@ -235,7 +235,7 @@ public class TileCharger extends AENetworkPowerTile implements ICrankable, IUpda
}
@Override
public boolean isItemValidForSlot( int i, ItemStack itemstack )
public boolean isItemValidForSlot( final int i, final ItemStack itemstack )
{
final IItemDefinition cert = AEApi.instance().definitions().materials().certusQuartzCrystal();
@@ -243,17 +243,17 @@ public class TileCharger extends AENetworkPowerTile implements ICrankable, IUpda
}
@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 )
{
this.markForUpdate();
}
@Override
public boolean canExtractItem( int slotIndex, ItemStack extractedItem, EnumFacing side )
public boolean canExtractItem( final int slotIndex, final ItemStack extractedItem, final EnumFacing side )
{
if( Platform.isChargeable( extractedItem ) )
{
IAEItemPowerStorage ips = (IAEItemPowerStorage) extractedItem.getItem();
final IAEItemPowerStorage ips = (IAEItemPowerStorage) extractedItem.getItem();
if( ips.getAECurrentPower( extractedItem ) >= ips.getAEMaxPower( extractedItem ) )
{
return true;
@@ -264,19 +264,19 @@ public class TileCharger extends AENetworkPowerTile implements ICrankable, IUpda
}
@Override
public int[] getAccessibleSlotsBySide( EnumFacing whichSide )
public int[] getAccessibleSlotsBySide( final EnumFacing whichSide )
{
return this.sides;
}
public void activate( EntityPlayer player )
public void activate( final EntityPlayer player )
{
if( !Platform.hasPermissions( new DimensionalCoord( this ), player ) )
{
return;
}
ItemStack myItem = this.getStackInSlot( 0 );
final ItemStack myItem = this.getStackInSlot( 0 );
if( myItem == null )
{
ItemStack held = player.inventory.getCurrentItem();
@@ -289,7 +289,7 @@ public class TileCharger extends AENetworkPowerTile implements ICrankable, IUpda
}
else
{
List<ItemStack> drops = new ArrayList<ItemStack>();
final List<ItemStack> drops = new ArrayList<ItemStack>();
drops.add( myItem );
this.setInventorySlotContents( 0, null );
Platform.spawnDrops( this.worldObj, pos.offset( getForward() ), drops );
@@ -60,14 +60,14 @@ public class TileCondenser extends AEBaseInvTile implements IFluidHandler, IConf
}
@TileEvent( TileEventType.WORLD_NBT_WRITE )
public void writeToNBT_TileCondenser( NBTTagCompound data )
public void writeToNBT_TileCondenser( final NBTTagCompound data )
{
this.cm.writeToNBT( data );
data.setDouble( "storedPower", this.storedPower );
}
@TileEvent( TileEventType.WORLD_NBT_READ )
public void readFromNBT_TileCondenser( NBTTagCompound data )
public void readFromNBT_TileCondenser( final NBTTagCompound data )
{
this.cm.readFromNBT( data );
this.storedPower = data.getDouble( "storedPower" );
@@ -75,12 +75,12 @@ public class TileCondenser extends AEBaseInvTile implements IFluidHandler, IConf
public double getStorage()
{
ItemStack is = this.inv.getStackInSlot( 2 );
final ItemStack is = this.inv.getStackInSlot( 2 );
if( is != null )
{
if( is.getItem() instanceof IStorageComponent )
{
IStorageComponent sc = (IStorageComponent) is.getItem();
final IStorageComponent sc = (IStorageComponent) is.getItem();
if( sc.isStorageComponent( is ) )
{
return sc.getBytes( is ) * 8;
@@ -90,13 +90,13 @@ public class TileCondenser extends AEBaseInvTile implements IFluidHandler, IConf
return 0;
}
public void addPower( double rawPower )
public void addPower( final double rawPower )
{
this.storedPower += rawPower;
this.storedPower = Math.max( 0.0, Math.min( this.getStorage(), this.storedPower ) );
double requiredPower = this.getRequiredPower();
ItemStack output = this.getOutput();
final double requiredPower = this.getRequiredPower();
final ItemStack output = this.getOutput();
while( requiredPower <= this.storedPower && output != null && requiredPower > 0 )
{
if( this.canAddOutput( output ) )
@@ -111,9 +111,9 @@ public class TileCondenser extends AEBaseInvTile implements IFluidHandler, IConf
}
}
private boolean canAddOutput( ItemStack output )
private boolean canAddOutput( final ItemStack output )
{
ItemStack outputStack = this.getStackInSlot( 1 );
final ItemStack outputStack = this.getStackInSlot( 1 );
return outputStack == null || ( Platform.isSameItem( outputStack, output ) && outputStack.stackSize < outputStack.getMaxStackSize() );
}
@@ -122,9 +122,9 @@ public class TileCondenser extends AEBaseInvTile implements IFluidHandler, IConf
*
* @param output to be added output
*/
private void addOutput( ItemStack output )
private void addOutput( final ItemStack output )
{
ItemStack outputStack = this.getStackInSlot( 1 );
final ItemStack outputStack = this.getStackInSlot( 1 );
if( outputStack == null )
{
this.setInventorySlotContents( 1, output.copy() );
@@ -143,13 +143,13 @@ public class TileCondenser extends AEBaseInvTile implements IFluidHandler, IConf
switch( (CondenserOutput) this.cm.getSetting( Settings.CONDENSER_OUTPUT ) )
{
case MATTER_BALLS:
for( ItemStack matterBallStack : materials.matterBall().maybeStack( 1 ).asSet() )
for( final ItemStack matterBallStack : materials.matterBall().maybeStack( 1 ).asSet() )
{
return matterBallStack;
}
case SINGULARITY:
for( ItemStack singularityStack : materials.singularity().maybeStack( 1 ).asSet() )
for( final ItemStack singularityStack : materials.singularity().maybeStack( 1 ).asSet() )
{
return singularityStack;
}
@@ -172,7 +172,7 @@ public class TileCondenser extends AEBaseInvTile implements IFluidHandler, IConf
}
@Override
public void setInventorySlotContents( int i, ItemStack itemstack )
public void setInventorySlotContents( final int i, final ItemStack itemstack )
{
if( i == 0 )
{
@@ -188,17 +188,17 @@ public class TileCondenser extends AEBaseInvTile implements IFluidHandler, IConf
}
@Override
public boolean isItemValidForSlot( int i, ItemStack itemstack )
public boolean isItemValidForSlot( final int i, final ItemStack itemstack )
{
return i == 0;
}
@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 == 0 )
{
ItemStack is = inv.getStackInSlot( 0 );
final ItemStack is = inv.getStackInSlot( 0 );
if( is != null )
{
this.addPower( is.stackSize );
@@ -208,25 +208,25 @@ public class TileCondenser extends AEBaseInvTile implements IFluidHandler, IConf
}
@Override
public boolean canInsertItem( int slotIndex, ItemStack insertingItem, EnumFacing side )
public boolean canInsertItem( final int slotIndex, final ItemStack insertingItem, final EnumFacing side )
{
return slotIndex == 0;
}
@Override
public boolean canExtractItem( int slotIndex, ItemStack extractedItem, EnumFacing side )
public boolean canExtractItem( final int slotIndex, final ItemStack extractedItem, final EnumFacing side )
{
return slotIndex != 0;
}
@Override
public int[] getAccessibleSlotsBySide( EnumFacing side )
public int[] getAccessibleSlotsBySide( final EnumFacing side )
{
return this.sides;
}
@Override
public int fill( EnumFacing from, FluidStack resource, boolean doFill )
public int fill( final EnumFacing from, final FluidStack resource, final boolean doFill )
{
if( doFill )
{
@@ -237,37 +237,37 @@ public class TileCondenser extends AEBaseInvTile implements IFluidHandler, IConf
}
@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 true;
}
@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 )
{
return EMPTY;
}
@Override
public void updateSetting( IConfigManager manager, Enum settingName, Enum newValue )
public void updateSetting( final IConfigManager manager, final Enum settingName, final Enum newValue )
{
this.addPower( 0 );
}
@@ -112,13 +112,13 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable,
}
@Override
public AECableType getCableConnectionType( AEPartLocation dir )
public AECableType getCableConnectionType( final AEPartLocation dir )
{
return AECableType.COVERED;
}
@TileEvent( TileEventType.WORLD_NBT_WRITE )
public void writeToNBT_TileInscriber( NBTTagCompound data )
public void writeToNBT_TileInscriber( final NBTTagCompound data )
{
this.inv.writeToNBT( data, "inscriberInv" );
this.upgrades.writeToNBT( data, "upgrades" );
@@ -126,7 +126,7 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable,
}
@TileEvent( TileEventType.WORLD_NBT_READ )
public void readFromNBT_TileInscriber( NBTTagCompound data )
public void readFromNBT_TileInscriber( final NBTTagCompound data )
{
this.inv.readFromNBT( data, "inscriberInv" );
this.upgrades.readFromNBT( data, "upgrades" );
@@ -134,12 +134,12 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable,
}
@TileEvent( TileEventType.NETWORK_READ )
public boolean readFromStream_TileInscriber( ByteBuf data ) throws IOException
public boolean readFromStream_TileInscriber( final ByteBuf data ) throws IOException
{
int slot = data.readByte();
final int slot = data.readByte();
boolean oldSmash = this.smash;
boolean newSmash = ( slot & 64 ) == 64;
final boolean oldSmash = this.smash;
final boolean newSmash = ( slot & 64 ) == 64;
if( oldSmash != newSmash && newSmash )
{
@@ -163,7 +163,7 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable,
}
@TileEvent( TileEventType.NETWORK_WRITE )
public void writeToStream_TileInscriber( ByteBuf data ) throws IOException
public void writeToStream_TileInscriber( final ByteBuf data ) throws IOException
{
int slot = this.smash ? 64 : 0;
@@ -180,14 +180,14 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable,
{
if( ( slot & ( 1 << num ) ) > 0 )
{
AEItemStack st = AEItemStack.create( this.inv.getStackInSlot( num ) );
final AEItemStack st = AEItemStack.create( this.inv.getStackInSlot( num ) );
st.writeToPacket( data );
}
}
}
@Override
public void setOrientation( EnumFacing inForward, EnumFacing inUp )
public void setOrientation( final EnumFacing inForward, final EnumFacing inUp )
{
super.setOrientation( inForward, inUp );
this.gridProxy.setValidSides( EnumSet.complementOf( EnumSet.of( this.getForward() ) ) );
@@ -196,15 +196,15 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable,
@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 h = 0; h < this.upgrades.getSizeInventory(); h++ )
{
ItemStack is = this.upgrades.getStackInSlot( h );
final ItemStack is = this.upgrades.getStackInSlot( h );
if( is != null )
{
drops.add( is );
@@ -231,7 +231,7 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable,
}
@Override
public boolean isItemValidForSlot( int i, ItemStack itemstack )
public boolean isItemValidForSlot( final int i, final ItemStack itemstack )
{
if( this.smash )
{
@@ -245,7 +245,7 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable,
return true;
}
for( ItemStack optionals : AEApi.instance().registries().inscriber().getOptionals() )
for( final ItemStack optionals : AEApi.instance().registries().inscriber().getOptionals() )
{
if( Platform.isSameItemPrecise( optionals, itemstack ) )
{
@@ -258,7 +258,7 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable,
}
@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 )
{
try
{
@@ -277,14 +277,14 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable,
this.gridProxy.getTick().wakeDevice( this.gridProxy.getNode() );
}
}
catch( GridAccessException e )
catch( final GridAccessException e )
{
// :P
}
}
@Override
public boolean canExtractItem( int slotIndex, ItemStack extractedItem, EnumFacing side )
public boolean canExtractItem( final int slotIndex, final ItemStack extractedItem, final EnumFacing side )
{
if( this.smash )
{
@@ -295,7 +295,7 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable,
}
@Override
public int[] getAccessibleSlotsBySide( EnumFacing d )
public int[] getAccessibleSlotsBySide( final EnumFacing d )
{
if( d == EnumFacing.UP )
{
@@ -311,7 +311,7 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable,
}
@Override
public TickingRequest getTickingRequest( IGridNode node )
public TickingRequest getTickingRequest( final IGridNode node )
{
return new TickingRequest( TickRates.Inscriber.min, TickRates.Inscriber.max, !this.hasWork(), false );
}
@@ -330,8 +330,8 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable,
@Nullable
public IInscriberRecipe getTask()
{
ItemStack plateA = this.getStackInSlot( 0 );
ItemStack plateB = this.getStackInSlot( 1 );
final ItemStack plateA = this.getStackInSlot( 0 );
final ItemStack plateB = this.getStackInSlot( 1 );
ItemStack renamedItem = this.getStackInSlot( 2 );
if( plateA != null && plateA.stackSize > 1 )
@@ -350,8 +350,8 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable,
}
final IComparableDefinition namePress = AEApi.instance().definitions().materials().namePress();
boolean isNameA = namePress.isSameAs( plateA );
boolean isNameB = namePress.isSameAs( plateB );
final boolean isNameA = namePress.isSameAs( plateA );
final boolean isNameB = namePress.isSameAs( plateB );
if( ( isNameA || isNameB ) && ( isNameA || plateA == null ) && ( isNameB || plateB == null ) )
{
@@ -361,13 +361,13 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable,
if( plateA != null )
{
NBTTagCompound tag = Platform.openNbtData( plateA );
final NBTTagCompound tag = Platform.openNbtData( plateA );
name += tag.getString( "InscribeName" );
}
if( plateB != null )
{
NBTTagCompound tag = Platform.openNbtData( plateB );
final NBTTagCompound tag = Platform.openNbtData( plateB );
if( name.length() > 0 )
{
name += " ";
@@ -375,11 +375,11 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable,
name += tag.getString( "InscribeName" );
}
ItemStack startingItem = renamedItem.copy();
final ItemStack startingItem = renamedItem.copy();
renamedItem = renamedItem.copy();
NBTTagCompound tag = Platform.openNbtData( renamedItem );
final NBTTagCompound tag = Platform.openNbtData( renamedItem );
NBTTagCompound display = tag.getCompoundTag( "display" );
final NBTTagCompound display = tag.getCompoundTag( "display" );
tag.setTag( "display", display );
if( name.length() > 0 )
@@ -398,18 +398,18 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable,
}
}
for( IInscriberRecipe recipe : AEApi.instance().registries().inscriber().getRecipes() )
for( final IInscriberRecipe recipe : AEApi.instance().registries().inscriber().getRecipes() )
{
boolean matchA = ( plateA == null && !recipe.getTopOptional().isPresent() ) || ( Platform.isSameItemPrecise( plateA, recipe.getTopOptional().orNull() ) ) && // and...
final boolean matchA = ( plateA == null && !recipe.getTopOptional().isPresent() ) || ( Platform.isSameItemPrecise( plateA, recipe.getTopOptional().orNull() ) ) && // and...
( plateB == null && !recipe.getBottomOptional().isPresent() ) | ( Platform.isSameItemPrecise( plateB, recipe.getBottomOptional().orNull() ) );
boolean matchB = ( plateB == null && !recipe.getTopOptional().isPresent() ) || ( Platform.isSameItemPrecise( plateB, recipe.getTopOptional().orNull() ) ) && // and...
final boolean matchB = ( plateB == null && !recipe.getTopOptional().isPresent() ) || ( Platform.isSameItemPrecise( plateB, recipe.getTopOptional().orNull() ) ) && // and...
( plateA == null && !recipe.getBottomOptional().isPresent() ) | ( Platform.isSameItemPrecise( plateA, recipe.getBottomOptional().orNull() ) );
if( matchA || matchB )
{
for( ItemStack option : recipe.getInputs() )
for( final ItemStack option : recipe.getInputs() )
{
if( Platform.isSameItemPrecise( option, this.getStackInSlot( 2 ) ) )
{
@@ -422,7 +422,7 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable,
}
@Override
public TickRateModulation tickingRequest( IGridNode node, int ticksSinceLastCall )
public TickRateModulation tickingRequest( final IGridNode node, final int ticksSinceLastCall )
{
if( this.smash )
{
@@ -433,7 +433,7 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable,
if( out != null )
{
final ItemStack outputCopy = out.getOutput().copy();
InventoryAdaptor ad = InventoryAdaptor.getAdaptor( new WrapperInventoryRange( this.inv, 3, 1, true ), EnumFacing.UP );
final InventoryAdaptor ad = InventoryAdaptor.getAdaptor( new WrapperInventoryRange( this.inv, 3, 1, true ), EnumFacing.UP );
if( ad.addItems( outputCopy ) == null )
{
@@ -460,13 +460,13 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable,
{
try
{
IEnergyGrid eg = this.gridProxy.getEnergy();
final IEnergyGrid eg = this.gridProxy.getEnergy();
IEnergySource src = this;
// Base 1, increase by 1 for each card
int speedFactor = 1 + this.upgrades.getInstalledUpgrades( Upgrades.SPEED );
int powerConsumption = 10 * speedFactor;
double powerThreshold = powerConsumption - 0.01;
final int speedFactor = 1 + this.upgrades.getInstalledUpgrades( Upgrades.SPEED );
final int powerConsumption = 10 * speedFactor;
final double powerThreshold = powerConsumption - 0.01;
double powerReq = this.extractAEPower( powerConsumption, Actionable.SIMULATE, PowerMultiplier.CONFIG );
if( powerReq <= powerThreshold )
@@ -489,7 +489,7 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable,
}
}
}
catch( GridAccessException e )
catch( final GridAccessException e )
{
// :P
}
@@ -497,11 +497,11 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable,
if( this.processingTime > this.maxProcessingTime )
{
this.processingTime = this.maxProcessingTime;
IInscriberRecipe out = this.getTask();
final IInscriberRecipe out = this.getTask();
if( out != null )
{
ItemStack outputCopy = out.getOutput().copy();
InventoryAdaptor ad = InventoryAdaptor.getAdaptor( new WrapperInventoryRange( this.inv, 3, 1, true ), EnumFacing.UP );
final ItemStack outputCopy = out.getOutput().copy();
final InventoryAdaptor ad = InventoryAdaptor.getAdaptor( new WrapperInventoryRange( this.inv, 3, 1, true ), EnumFacing.UP );
if( ad.simulateAdd( outputCopy ) == null )
{
this.smash = true;
@@ -522,7 +522,7 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable,
}
@Override
public IInventory getInventoryByName( String name )
public IInventory getInventoryByName( final String name )
{
if( name.equals( "inv" ) )
{
@@ -538,13 +538,13 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable,
}
@Override
public int getInstalledUpgrades( Upgrades u )
public int getInstalledUpgrades( final Upgrades u )
{
return this.upgrades.getInstalledUpgrades( u );
}
@Override
public void updateSetting( IConfigManager manager, Enum settingName, Enum newValue )
public void updateSetting( final IConfigManager manager, final Enum settingName, final Enum newValue )
{
}
}
@@ -72,18 +72,18 @@ public class TileInterface extends AENetworkInvTile implements IGridTickable, IT
AEPartLocation pointAt = AEPartLocation.INTERNAL;
@MENetworkEventSubscribe
public void stateChange( MENetworkChannelsChanged c )
public void stateChange( final MENetworkChannelsChanged c )
{
this.duality.notifyNeighbors();
}
@MENetworkEventSubscribe
public void stateChange( MENetworkPowerStatusChange c )
public void stateChange( final MENetworkPowerStatusChange c )
{
this.duality.notifyNeighbors();
}
public void setSide( AEPartLocation axis )
public void setSide( final AEPartLocation axis )
{
if( Platform.isClient() )
{
@@ -137,9 +137,9 @@ public class TileInterface extends AENetworkInvTile implements IGridTickable, IT
@Override
public void getDrops(
World w,
BlockPos pos,
List<ItemStack> drops )
final World w,
final BlockPos pos,
final List<ItemStack> drops )
{
this.duality.addDrops( drops );
}
@@ -159,16 +159,16 @@ public class TileInterface extends AENetworkInvTile implements IGridTickable, IT
}
@TileEvent( TileEventType.WORLD_NBT_WRITE )
public void writeToNBT_TileInterface( NBTTagCompound data )
public void writeToNBT_TileInterface( final NBTTagCompound data )
{
data.setInteger( "pointAt", this.pointAt.ordinal() );
this.duality.writeToNBT( data );
}
@TileEvent( TileEventType.WORLD_NBT_READ )
public void readFromNBT_TileInterface( NBTTagCompound data )
public void readFromNBT_TileInterface( final NBTTagCompound data )
{
int val = data.getInteger( "pointAt" );
final int val = data.getInteger( "pointAt" );
if( val >= 0 && val < AEPartLocation.values().length )
{
@@ -183,7 +183,7 @@ public class TileInterface extends AENetworkInvTile implements IGridTickable, IT
}
@Override
public AECableType getCableConnectionType( AEPartLocation dir )
public AECableType getCableConnectionType( final AEPartLocation dir )
{
return this.duality.getCableConnectionType( dir );
}
@@ -195,7 +195,7 @@ public class TileInterface extends AENetworkInvTile implements IGridTickable, IT
}
@Override
public boolean canInsert( ItemStack stack )
public boolean canInsert( final ItemStack stack )
{
return this.duality.canInsert( stack );
}
@@ -213,19 +213,19 @@ public class TileInterface extends AENetworkInvTile implements IGridTickable, IT
}
@Override
public IInventory getInventoryByName( String name )
public IInventory getInventoryByName( final String name )
{
return this.duality.getInventoryByName( name );
}
@Override
public TickingRequest getTickingRequest( IGridNode node )
public TickingRequest getTickingRequest( final IGridNode node )
{
return this.duality.getTickingRequest( node );
}
@Override
public TickRateModulation tickingRequest( IGridNode node, int ticksSinceLastCall )
public TickRateModulation tickingRequest( final IGridNode node, final int ticksSinceLastCall )
{
return this.duality.tickingRequest( node, ticksSinceLastCall );
}
@@ -237,13 +237,13 @@ public class TileInterface extends AENetworkInvTile implements IGridTickable, IT
}
@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 )
{
this.duality.onChangeInventory( inv, slot, mc, removed, added );
}
@Override
public int[] getAccessibleSlotsBySide( EnumFacing side )
public int[] getAccessibleSlotsBySide( final EnumFacing side )
{
return this.duality.getSlotsForFace( side );
}
@@ -271,7 +271,7 @@ public class TileInterface extends AENetworkInvTile implements IGridTickable, IT
}
@Override
public IStorageMonitorable getMonitorable( EnumFacing side, BaseActionSource src )
public IStorageMonitorable getMonitorable( final EnumFacing side, final BaseActionSource src )
{
return this.duality.getMonitorable( side, src, this );
}
@@ -283,7 +283,7 @@ public class TileInterface extends AENetworkInvTile implements IGridTickable, IT
}
@Override
public boolean pushPattern( ICraftingPatternDetails patternDetails, InventoryCrafting table )
public boolean pushPattern( final ICraftingPatternDetails patternDetails, final InventoryCrafting table )
{
return this.duality.pushPattern( patternDetails, table );
}
@@ -295,13 +295,13 @@ public class TileInterface extends AENetworkInvTile implements IGridTickable, IT
}
@Override
public void provideCrafting( ICraftingProviderHelper craftingTracker )
public void provideCrafting( final ICraftingProviderHelper craftingTracker )
{
this.duality.provideCrafting( craftingTracker );
}
@Override
public int getInstalledUpgrades( Upgrades u )
public int getInstalledUpgrades( final Upgrades u )
{
return this.duality.getInstalledUpgrades( u );
}
@@ -313,13 +313,13 @@ public class TileInterface extends AENetworkInvTile implements IGridTickable, IT
}
@Override
public IAEItemStack injectCraftedItems( ICraftingLink link, IAEItemStack items, Actionable mode )
public IAEItemStack injectCraftedItems( final ICraftingLink link, final IAEItemStack items, final Actionable mode )
{
return this.duality.injectCraftedItems( link, items, mode );
}
@Override
public void jobStateChange( ICraftingLink link )
public void jobStateChange( final ICraftingLink link )
{
this.duality.jobStateChange( link );
}
@@ -331,7 +331,7 @@ public class TileInterface extends AENetworkInvTile implements IGridTickable, IT
}
@Override
public void setPriority( int newValue )
public void setPriority( final int newValue )
{
this.duality.setPriority( newValue );
}
@@ -50,7 +50,7 @@ public class TileLightDetector extends AEBaseTile implements IUpdatePlayerListBo
public void updateLight()
{
int val = this.worldObj.getLight( pos );
final int val = this.worldObj.getLight( pos );
if( this.lastLight != val )
{
+25 -25
View File
@@ -59,9 +59,9 @@ public class TilePaint extends AEBaseTile
}
@TileEvent( TileEventType.WORLD_NBT_WRITE )
public void writeToNBT_TilePaint( NBTTagCompound data )
public void writeToNBT_TilePaint( final NBTTagCompound data )
{
ByteBuf myDat = Unpooled.buffer();
final ByteBuf myDat = Unpooled.buffer();
this.writeBuffer( myDat );
if( myDat.hasArray() )
{
@@ -69,7 +69,7 @@ public class TilePaint extends AEBaseTile
}
}
void writeBuffer( ByteBuf out )
void writeBuffer( final ByteBuf out )
{
if( this.dots == null )
{
@@ -79,14 +79,14 @@ public class TilePaint extends AEBaseTile
out.writeByte( this.dots.size() );
for( Splotch s : this.dots )
for( final Splotch s : this.dots )
{
s.writeToStream( out );
}
}
@TileEvent( TileEventType.WORLD_NBT_READ )
public void readFromNBT_TilePaint( NBTTagCompound data )
public void readFromNBT_TilePaint( final NBTTagCompound data )
{
if( data.hasKey( "dots" ) )
{
@@ -94,9 +94,9 @@ public class TilePaint extends AEBaseTile
}
}
void readBuffer( ByteBuf in )
void readBuffer( final ByteBuf in )
{
byte howMany = in.readByte();
final byte howMany = in.readByte();
if( howMany == 0 )
{
@@ -112,7 +112,7 @@ public class TilePaint extends AEBaseTile
}
this.isLit = 0;
for( Splotch s : this.dots )
for( final Splotch s : this.dots )
{
if( s.lumen )
{
@@ -137,13 +137,13 @@ public class TilePaint extends AEBaseTile
}
@TileEvent( TileEventType.NETWORK_WRITE )
public void writeToStream_TilePaint( ByteBuf data )
public void writeToStream_TilePaint( final ByteBuf data )
{
this.writeBuffer( data );
}
@TileEvent( TileEventType.NETWORK_READ )
public boolean readFromStream_TilePaint( ByteBuf data )
public boolean readFromStream_TilePaint( final ByteBuf data )
{
this.readBuffer( data );
return true;
@@ -156,7 +156,7 @@ public class TilePaint extends AEBaseTile
return;
}
for( EnumFacing side : EnumFacing.VALUES )
for( final EnumFacing side : EnumFacing.VALUES )
{
if( !this.isSideValid( side ) )
{
@@ -167,19 +167,19 @@ public class TilePaint extends AEBaseTile
this.updateData();
}
public boolean isSideValid( EnumFacing side )
public boolean isSideValid( final EnumFacing side )
{
BlockPos p = pos.offset( side );
IBlockState blk = this.worldObj.getBlockState( p );
final BlockPos p = pos.offset( side );
final IBlockState blk = this.worldObj.getBlockState( p );
return blk.getBlock().isSideSolid( this.worldObj, p, side.getOpposite() );
}
private void removeSide( EnumFacing side )
private void removeSide( final EnumFacing side )
{
Iterator<Splotch> i = this.dots.iterator();
final Iterator<Splotch> i = this.dots.iterator();
while( i.hasNext() )
{
Splotch s = i.next();
final Splotch s = i.next();
if( s.side == side )
{
i.remove();
@@ -193,7 +193,7 @@ public class TilePaint extends AEBaseTile
private void updateData()
{
this.isLit = 0;
for( Splotch s : this.dots )
for( final Splotch s : this.dots )
{
if( s.lumen )
{
@@ -214,7 +214,7 @@ public class TilePaint extends AEBaseTile
}
}
public void cleanSide( EnumFacing side )
public void cleanSide( final EnumFacing side )
{
if( this.dots == null )
{
@@ -231,17 +231,17 @@ public class TilePaint extends AEBaseTile
return this.isLit;
}
public void addBlot( ItemStack type, EnumFacing side, Vec3 hitVec )
public void addBlot( final ItemStack type, final EnumFacing side, final Vec3 hitVec )
{
BlockPos p = pos.offset(side);
final BlockPos p = pos.offset(side);
IBlockState blk = this.worldObj.getBlockState( p );
final IBlockState blk = this.worldObj.getBlockState( p );
if( blk.getBlock().isSideSolid( this.worldObj, p, side.getOpposite() ) )
{
ItemPaintBall ipb = (ItemPaintBall) type.getItem();
final ItemPaintBall ipb = (ItemPaintBall) type.getItem();
AEColor col = ipb.getColor( type );
boolean lit = ipb.isLumen( type );
final AEColor col = ipb.getColor( type );
final boolean lit = ipb.isLumen( type );
if( this.dots == null )
{
@@ -50,40 +50,40 @@ public class TileQuartzGrowthAccelerator extends AENetworkTile implements IPower
}
@MENetworkEventSubscribe
public void onPower( MENetworkPowerStatusChange ch )
public void onPower( final MENetworkPowerStatusChange ch )
{
this.markForUpdate();
}
@Override
public AECableType getCableConnectionType( AEPartLocation dir )
public AECableType getCableConnectionType( final AEPartLocation dir )
{
return AECableType.COVERED;
}
@TileEvent( TileEventType.NETWORK_READ )
public boolean readFromStream_TileQuartzGrowthAccelerator( ByteBuf data )
public boolean readFromStream_TileQuartzGrowthAccelerator( final ByteBuf data )
{
boolean hadPower = this.hasPower;
final boolean hadPower = this.hasPower;
this.hasPower = data.readBoolean();
return this.hasPower != hadPower;
}
@TileEvent( TileEventType.NETWORK_WRITE )
public void writeToStream_TileQuartzGrowthAccelerator( ByteBuf data )
public void writeToStream_TileQuartzGrowthAccelerator( final ByteBuf data )
{
try
{
data.writeBoolean( this.gridProxy.getEnergy().isNetworkPowered() );
}
catch( GridAccessException e )
catch( final GridAccessException e )
{
data.writeBoolean( false );
}
}
@Override
public void setOrientation( EnumFacing inForward, EnumFacing inUp )
public void setOrientation( final EnumFacing inForward, final EnumFacing inUp )
{
super.setOrientation( inForward, inUp );
this.gridProxy.setValidSides( EnumSet.of( this.getUp(), this.getUp().getOpposite() ) );
@@ -98,7 +98,7 @@ public class TileQuartzGrowthAccelerator extends AENetworkTile implements IPower
{
return this.gridProxy.getEnergy().isNetworkPowered();
}
catch( GridAccessException e )
catch( final GridAccessException e )
{
return false;
}
@@ -109,23 +109,23 @@ public class TileSecurity extends AENetworkTile implements ITerminalHost, IAEApp
}
@Override
public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removedStack, ItemStack newStack )
public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removedStack, final ItemStack newStack )
{
}
@Override
public void getDrops(
World w,
BlockPos pos,
List<ItemStack> drops )
final World w,
final BlockPos pos,
final List<ItemStack> drops )
{
if( !this.configSlot.isEmpty() )
{
drops.add( this.configSlot.getStackInSlot( 0 ) );
}
for( IAEItemStack ais : this.inventory.storedItems )
for( final IAEItemStack ais : this.inventory.storedItems )
{
drops.add( ais.getItemStack() );
}
@@ -137,26 +137,26 @@ public class TileSecurity extends AENetworkTile implements ITerminalHost, IAEApp
}
@TileEvent( TileEventType.NETWORK_READ )
public boolean readFromStream_TileSecurity( ByteBuf data )
public boolean readFromStream_TileSecurity( final ByteBuf data )
{
boolean wasActive = this.isActive;
final boolean wasActive = this.isActive;
this.isActive = data.readBoolean();
AEColor oldPaintedColor = this.paintedColor;
final AEColor oldPaintedColor = this.paintedColor;
this.paintedColor = AEColor.values()[data.readByte()];
return oldPaintedColor != this.paintedColor || wasActive != this.isActive;
}
@TileEvent( TileEventType.NETWORK_WRITE )
public void writeToStream_TileSecurity( ByteBuf data )
public void writeToStream_TileSecurity( final ByteBuf data )
{
data.writeBoolean( this.gridProxy.isActive() );
data.writeByte( this.paintedColor.ordinal() );
}
@TileEvent( TileEventType.WORLD_NBT_WRITE )
public void writeToNBT_TileSecurity( NBTTagCompound data )
public void writeToNBT_TileSecurity( final NBTTagCompound data )
{
this.cm.writeToNBT( data );
data.setByte( "paintedColor", (byte) this.paintedColor.ordinal() );
@@ -164,12 +164,12 @@ public class TileSecurity extends AENetworkTile implements ITerminalHost, IAEApp
data.setLong( "securityKey", this.securityKey );
this.configSlot.writeToNBT( data, "config" );
NBTTagCompound storedItems = new NBTTagCompound();
final NBTTagCompound storedItems = new NBTTagCompound();
int offset = 0;
for( IAEItemStack ais : this.inventory.storedItems )
for( final IAEItemStack ais : this.inventory.storedItems )
{
NBTTagCompound it = new NBTTagCompound();
final NBTTagCompound it = new NBTTagCompound();
ais.getItemStack().writeToNBT( it );
storedItems.setTag( String.valueOf( offset ), it );
offset++;
@@ -179,7 +179,7 @@ public class TileSecurity extends AENetworkTile implements ITerminalHost, IAEApp
}
@TileEvent( TileEventType.WORLD_NBT_READ )
public void readFromNBT_TileSecurity( NBTTagCompound data )
public void readFromNBT_TileSecurity( final NBTTagCompound data )
{
this.cm.readFromNBT( data );
if( data.hasKey( "paintedColor" ) )
@@ -190,10 +190,10 @@ public class TileSecurity extends AENetworkTile implements ITerminalHost, IAEApp
this.securityKey = data.getLong( "securityKey" );
this.configSlot.readFromNBT( data, "config" );
NBTTagCompound storedItems = data.getCompoundTag( "storedItems" );
for( Object key : storedItems.getKeySet() )
final NBTTagCompound storedItems = data.getCompoundTag( "storedItems" );
for( final Object key : storedItems.getKeySet() )
{
NBTBase obj = storedItems.getTag( (String) key );
final NBTBase obj = storedItems.getTag( (String) key );
if( obj instanceof NBTTagCompound )
{
this.inventory.storedItems.add( AEItemStack.create( ItemStack.loadItemStackFromNBT( (NBTTagCompound) obj ) ) );
@@ -208,26 +208,26 @@ public class TileSecurity extends AENetworkTile implements ITerminalHost, IAEApp
this.saveChanges();
this.gridProxy.getGrid().postEvent( new MENetworkSecurityChange() );
}
catch( GridAccessException e )
catch( final GridAccessException e )
{
// :P
}
}
@MENetworkEventSubscribe
public void bootUpdate( MENetworkChannelsChanged changed )
public void bootUpdate( final MENetworkChannelsChanged changed )
{
this.markForUpdate();
}
@MENetworkEventSubscribe
public void powerUpdate( MENetworkPowerStatusChange changed )
public void powerUpdate( final MENetworkPowerStatusChange changed )
{
this.markForUpdate();
}
@Override
public AECableType getCableConnectionType( AEPartLocation dir )
public AECableType getCableConnectionType( final AEPartLocation dir )
{
return AECableType.SMART;
}
@@ -300,7 +300,7 @@ public class TileSecurity extends AENetworkTile implements ITerminalHost, IAEApp
}
@Override
public void updateSetting( IConfigManager manager, Enum settingName, Enum newValue )
public void updateSetting( final IConfigManager manager, final Enum settingName, final Enum newValue )
{
}
@@ -312,18 +312,18 @@ public class TileSecurity extends AENetworkTile implements ITerminalHost, IAEApp
}
@Override
public void readPermissions( HashMap<Integer, EnumSet<SecurityPermissions>> playerPerms )
public void readPermissions( final HashMap<Integer, EnumSet<SecurityPermissions>> playerPerms )
{
IPlayerRegistry pr = AEApi.instance().registries().players();
final IPlayerRegistry pr = AEApi.instance().registries().players();
// read permissions
for( IAEItemStack ais : this.inventory.storedItems )
for( final IAEItemStack ais : this.inventory.storedItems )
{
ItemStack is = ais.getItemStack();
Item i = is.getItem();
final ItemStack is = ais.getItemStack();
final Item i = is.getItem();
if( i instanceof IBiometricCard )
{
IBiometricCard bc = (IBiometricCard) i;
final IBiometricCard bc = (IBiometricCard) i;
bc.registerPermissions( new PlayerSecurityWrapper( playerPerms ), pr, is );
}
}
@@ -351,7 +351,7 @@ public class TileSecurity extends AENetworkTile implements ITerminalHost, IAEApp
}
@Override
public boolean recolourBlock( EnumFacing side, AEColor newPaintedColor, EntityPlayer who )
public boolean recolourBlock( final EnumFacing side, final AEColor newPaintedColor, final EntityPlayer who )
{
if( this.paintedColor == newPaintedColor )
{
@@ -71,14 +71,14 @@ public class TileVibrationChamber extends AENetworkInvTile implements IGridTicka
}
@Override
public AECableType getCableConnectionType( AEPartLocation dir )
public AECableType getCableConnectionType( final AEPartLocation dir )
{
return AECableType.COVERED;
}
@Reflected
@TileEvent( TileEventType.NETWORK_READ )
public boolean hasUpdate( ByteBuf data )
public boolean hasUpdate( final ByteBuf data )
{
final boolean wasOn = this.isOn;
@@ -89,13 +89,13 @@ public class TileVibrationChamber extends AENetworkInvTile implements IGridTicka
@Reflected
@TileEvent( TileEventType.NETWORK_WRITE )
public void writeToNetwork( ByteBuf data )
public void writeToNetwork( final ByteBuf data )
{
data.writeBoolean( this.burnTime > 0 );
}
@TileEvent( TileEventType.WORLD_NBT_WRITE )
public void writeToNBT_TileVibrationChamber( NBTTagCompound data )
public void writeToNBT_TileVibrationChamber( final NBTTagCompound data )
{
data.setDouble( "burnTime", this.burnTime );
data.setDouble( "maxBurnTime", this.maxBurnTime );
@@ -103,7 +103,7 @@ public class TileVibrationChamber extends AENetworkInvTile implements IGridTicka
}
@TileEvent( TileEventType.WORLD_NBT_READ )
public void readFromNBT_TileVibrationChamber( NBTTagCompound data )
public void readFromNBT_TileVibrationChamber( final NBTTagCompound data )
{
this.burnTime = data.getDouble( "burnTime" );
this.maxBurnTime = data.getDouble( "maxBurnTime" );
@@ -117,13 +117,13 @@ public class TileVibrationChamber extends AENetworkInvTile implements IGridTicka
}
@Override
public boolean isItemValidForSlot( int i, ItemStack itemstack )
public boolean isItemValidForSlot( final int i, final ItemStack itemstack )
{
return TileEntityFurnace.getItemBurnTime( itemstack ) > 0;
}
@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.burnTime <= 0 )
{
@@ -133,7 +133,7 @@ public class TileVibrationChamber extends AENetworkInvTile implements IGridTicka
{
this.gridProxy.getTick().wakeDevice( this.gridProxy.getNode() );
}
catch( GridAccessException e )
catch( final GridAccessException e )
{
// wake up!
}
@@ -142,23 +142,23 @@ public class TileVibrationChamber extends AENetworkInvTile implements IGridTicka
}
@Override
public boolean canExtractItem( int slotIndex, ItemStack extractedItem, EnumFacing side )
public boolean canExtractItem( final int slotIndex, final ItemStack extractedItem, final EnumFacing side )
{
return extractedItem.getItem() == Items.bucket;
}
@Override
public int[] getAccessibleSlotsBySide( EnumFacing side )
public int[] getAccessibleSlotsBySide( final EnumFacing side )
{
return ACCESSIBLE_SLOTS;
}
private boolean canEatFuel()
{
ItemStack is = this.getStackInSlot( FUEL_SLOT_INDEX );
final ItemStack is = this.getStackInSlot( FUEL_SLOT_INDEX );
if( is != null )
{
int newBurnTime = TileEntityFurnace.getItemBurnTime( is );
final int newBurnTime = TileEntityFurnace.getItemBurnTime( is );
if( newBurnTime > 0 && is.stackSize > 0 )
{
return true;
@@ -174,7 +174,7 @@ public class TileVibrationChamber extends AENetworkInvTile implements IGridTicka
}
@Override
public TickingRequest getTickingRequest( IGridNode node )
public TickingRequest getTickingRequest( final IGridNode node )
{
if( this.burnTime <= 0 )
{
@@ -185,7 +185,7 @@ public class TileVibrationChamber extends AENetworkInvTile implements IGridTicka
}
@Override
public TickRateModulation tickingRequest( IGridNode node, int ticksSinceLastCall )
public TickRateModulation tickingRequest( final IGridNode node, final int ticksSinceLastCall )
{
if( this.burnTime <= 0 )
{
@@ -201,7 +201,7 @@ public class TileVibrationChamber extends AENetworkInvTile implements IGridTicka
}
this.burnSpeed = Math.max( MIN_BURN_SPEED, Math.min( this.burnSpeed, MAX_BURN_SPEED ) );
double dilation = this.burnSpeed / DILATION_SCALING;
final double dilation = this.burnSpeed / DILATION_SCALING;
double timePassed = ticksSinceLastCall * dilation;
this.burnTime -= timePassed;
@@ -213,9 +213,9 @@ public class TileVibrationChamber extends AENetworkInvTile implements IGridTicka
try
{
IEnergyGrid grid = this.gridProxy.getEnergy();
double newPower = timePassed * POWER_PER_TICK;
double overFlow = grid.injectPower( newPower, Actionable.SIMULATE );
final IEnergyGrid grid = this.gridProxy.getEnergy();
final double newPower = timePassed * POWER_PER_TICK;
final double overFlow = grid.injectPower( newPower, Actionable.SIMULATE );
// burn the over flow.
grid.injectPower( Math.max( 0.0, newPower - overFlow ), Actionable.MODULATE );
@@ -232,7 +232,7 @@ public class TileVibrationChamber extends AENetworkInvTile implements IGridTicka
this.burnSpeed = Math.max( MIN_BURN_SPEED, Math.min( this.burnSpeed, MAX_BURN_SPEED ) );
return overFlow > 0 ? TickRateModulation.SLOWER : TickRateModulation.FASTER;
}
catch( GridAccessException e )
catch( final GridAccessException e )
{
this.burnSpeed -= ticksSinceLastCall;
this.burnSpeed = Math.max( MIN_BURN_SPEED, Math.min( this.burnSpeed, MAX_BURN_SPEED ) );
@@ -277,7 +277,7 @@ public class TileVibrationChamber extends AENetworkInvTile implements IGridTicka
{
this.gridProxy.getTick().wakeDevice( this.gridProxy.getNode() );
}
catch( GridAccessException e )
catch( final GridAccessException e )
{
// gah!
}