final variables and parameters

seeing some methods it does actually help to enforce the parameters
This commit is contained in:
thatsIch
2015-09-25 23:10:56 +02:00
parent e52400bf26
commit 410d2f1e0d
819 changed files with 9390 additions and 9396 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;
@@ -235,7 +235,7 @@ public class TileCellWorkbench extends AEBaseTile implements IUpgradeableHost, I
}
@Override
public void getDrops( World w, int x, int y, int z, List<ItemStack> drops )
public void getDrops( final World w, final int x, final int y, final int z, final List<ItemStack> drops )
{
super.getDrops( w, x, y, z, drops );
@@ -252,7 +252,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
@@ -71,21 +71,21 @@ public class TileCharger extends AENetworkPowerTile implements ICrankable
}
@Override
public AECableType getCableConnectionType( ForgeDirection dir )
public AECableType getCableConnectionType( final ForgeDirection 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 );
}
@@ -93,9 +93,9 @@ public class TileCharger extends AENetworkPowerTile implements ICrankable
}
@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 );
@@ -120,7 +120,7 @@ public class TileCharger extends AENetworkPowerTile implements ICrankable
}
this.tickTickTimer = 0;
ItemStack myItem = this.getStackInSlot( 0 );
final ItemStack myItem = this.getStackInSlot( 0 );
// charge from the network!
if( this.internalCurrentPower < 1499 )
@@ -130,7 +130,7 @@ public class TileCharger extends AENetworkPowerTile implements ICrankable
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!
}
@@ -145,12 +145,12 @@ public class TileCharger extends AENetworkPowerTile implements ICrankable
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 )
{
@@ -165,7 +165,7 @@ public class TileCharger extends AENetworkPowerTile implements ICrankable
{
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 );
}
@@ -174,7 +174,7 @@ public class TileCharger extends AENetworkPowerTile implements ICrankable
}
@Override
public void setOrientation( ForgeDirection inForward, ForgeDirection inUp )
public void setOrientation( final ForgeDirection inForward, final ForgeDirection inUp )
{
super.setOrientation( inForward, inUp );
this.gridProxy.setValidSides( EnumSet.of( this.getUp(), this.getUp().getOpposite() ) );
@@ -198,7 +198,7 @@ public class TileCharger extends AENetworkPowerTile implements ICrankable
{
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();
@@ -207,7 +207,7 @@ public class TileCharger extends AENetworkPowerTile implements ICrankable
{
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 );
}
@@ -216,7 +216,7 @@ public class TileCharger extends AENetworkPowerTile implements ICrankable
}
@Override
public boolean canCrankAttach( ForgeDirection directionToCrank )
public boolean canCrankAttach( final ForgeDirection directionToCrank )
{
return this.getUp() == directionToCrank || this.getUp().getOpposite() == directionToCrank;
}
@@ -234,7 +234,7 @@ public class TileCharger extends AENetworkPowerTile implements ICrankable
}
@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();
@@ -242,17 +242,17 @@ public class TileCharger extends AENetworkPowerTile implements ICrankable
}
@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, int side )
public boolean canExtractItem( final int slotIndex, final ItemStack extractedItem, final int 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;
@@ -263,19 +263,19 @@ public class TileCharger extends AENetworkPowerTile implements ICrankable
}
@Override
public int[] getAccessibleSlotsBySide( ForgeDirection whichSide )
public int[] getAccessibleSlotsBySide( final ForgeDirection 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();
@@ -288,7 +288,7 @@ public class TileCharger extends AENetworkPowerTile implements ICrankable
}
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, this.xCoord + this.getForward().offsetX, this.yCoord + this.getForward().offsetY, this.zCoord + this.getForward().offsetZ, drops );
@@ -61,14 +61,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" );
@@ -76,12 +76,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;
@@ -91,13 +91,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 ) )
@@ -112,9 +112,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() );
}
@@ -123,9 +123,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() );
@@ -144,13 +144,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;
}
@@ -173,7 +173,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 )
{
@@ -189,17 +189,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 );
@@ -209,25 +209,25 @@ public class TileCondenser extends AEBaseInvTile implements IFluidHandler, IConf
}
@Override
public boolean canInsertItem( int slotIndex, ItemStack insertingItem, int side )
public boolean canInsertItem( final int slotIndex, final ItemStack insertingItem, final int side )
{
return slotIndex == 0;
}
@Override
public boolean canExtractItem( int slotIndex, ItemStack extractedItem, int side )
public boolean canExtractItem( final int slotIndex, final ItemStack extractedItem, final int side )
{
return slotIndex != 0;
}
@Override
public int[] getAccessibleSlotsBySide( ForgeDirection side )
public int[] getAccessibleSlotsBySide( final ForgeDirection side )
{
return this.sides;
}
@Override
public int fill( ForgeDirection from, FluidStack resource, boolean doFill )
public int fill( final ForgeDirection from, final FluidStack resource, final boolean doFill )
{
if( doFill )
{
@@ -238,37 +238,37 @@ public class TileCondenser extends AEBaseInvTile implements IFluidHandler, IConf
}
@Override
public FluidStack drain( ForgeDirection from, FluidStack resource, boolean doDrain )
public FluidStack drain( final ForgeDirection from, final FluidStack resource, final boolean doDrain )
{
return null;
}
@Override
public FluidStack drain( ForgeDirection from, int maxDrain, boolean doDrain )
public FluidStack drain( final ForgeDirection from, final int maxDrain, final boolean doDrain )
{
return null;
}
@Override
public boolean canFill( ForgeDirection from, Fluid fluid )
public boolean canFill( final ForgeDirection from, final Fluid fluid )
{
return true;
}
@Override
public boolean canDrain( ForgeDirection from, Fluid fluid )
public boolean canDrain( final ForgeDirection from, final Fluid fluid )
{
return false;
}
@Override
public FluidTankInfo[] getTankInfo( ForgeDirection from )
public FluidTankInfo[] getTankInfo( final ForgeDirection 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 );
}
@@ -111,13 +111,13 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable,
}
@Override
public AECableType getCableConnectionType( ForgeDirection dir )
public AECableType getCableConnectionType( final ForgeDirection 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" );
@@ -125,7 +125,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" );
@@ -133,12 +133,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 )
{
@@ -162,7 +162,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;
@@ -179,14 +179,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( ForgeDirection inForward, ForgeDirection inUp )
public void setOrientation( final ForgeDirection inForward, final ForgeDirection inUp )
{
super.setOrientation( inForward, inUp );
this.gridProxy.setValidSides( EnumSet.complementOf( EnumSet.of( this.getForward() ) ) );
@@ -194,13 +194,13 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable,
}
@Override
public void getDrops( World w, int x, int y, int z, List<ItemStack> drops )
public void getDrops( final World w, final int x, final int y, final int z, final List<ItemStack> drops )
{
super.getDrops( w, x, y, z, 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 );
@@ -227,7 +227,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 )
{
@@ -241,7 +241,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 ) )
{
@@ -254,7 +254,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
{
@@ -273,14 +273,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, int side )
public boolean canExtractItem( final int slotIndex, final ItemStack extractedItem, final int side )
{
if( this.smash )
{
@@ -291,7 +291,7 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable,
}
@Override
public int[] getAccessibleSlotsBySide( ForgeDirection d )
public int[] getAccessibleSlotsBySide( final ForgeDirection d )
{
if( d == ForgeDirection.UP )
{
@@ -307,7 +307,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 );
}
@@ -326,8 +326,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 )
@@ -346,8 +346,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 ) )
{
@@ -357,13 +357,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 += " ";
@@ -371,11 +371,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 )
@@ -394,18 +394,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 ) ) )
{
@@ -418,7 +418,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 )
{
@@ -429,7 +429,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 ), ForgeDirection.UNKNOWN );
final InventoryAdaptor ad = InventoryAdaptor.getAdaptor( new WrapperInventoryRange( this.inv, 3, 1, true ), ForgeDirection.UNKNOWN );
if( ad.addItems( outputCopy ) == null )
{
@@ -456,13 +456,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 )
@@ -485,7 +485,7 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable,
}
}
}
catch( GridAccessException e )
catch( final GridAccessException e )
{
// :P
}
@@ -493,11 +493,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 ), ForgeDirection.UNKNOWN );
final ItemStack outputCopy = out.getOutput().copy();
final InventoryAdaptor ad = InventoryAdaptor.getAdaptor( new WrapperInventoryRange( this.inv, 3, 1, true ), ForgeDirection.UNKNOWN );
if( ad.simulateAdd( outputCopy ) == null )
{
this.smash = true;
@@ -518,7 +518,7 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable,
}
@Override
public IInventory getInventoryByName( String name )
public IInventory getInventoryByName( final String name )
{
if( name.equals( "inv" ) )
{
@@ -534,13 +534,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 )
{
}
}
@@ -71,18 +71,18 @@ public class TileInterface extends AENetworkInvTile implements IGridTickable, IT
ForgeDirection pointAt = ForgeDirection.UNKNOWN;
@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( ForgeDirection axis )
public void setSide( final ForgeDirection axis )
{
if( Platform.isClient() )
{
@@ -127,7 +127,7 @@ public class TileInterface extends AENetworkInvTile implements IGridTickable, IT
}
@Override
public void getDrops( World w, int x, int y, int z, List<ItemStack> drops )
public void getDrops( final World w, final int x, final int y, final int z, final List<ItemStack> drops )
{
this.duality.addDrops( drops );
}
@@ -147,16 +147,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 < ForgeDirection.values().length )
{
@@ -171,7 +171,7 @@ public class TileInterface extends AENetworkInvTile implements IGridTickable, IT
}
@Override
public AECableType getCableConnectionType( ForgeDirection dir )
public AECableType getCableConnectionType( final ForgeDirection dir )
{
return this.duality.getCableConnectionType( dir );
}
@@ -183,7 +183,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 );
}
@@ -201,19 +201,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 );
}
@@ -225,13 +225,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( ForgeDirection side )
public int[] getAccessibleSlotsBySide( final ForgeDirection side )
{
return this.duality.getAccessibleSlotsFromSide( side.ordinal() );
}
@@ -259,7 +259,7 @@ public class TileInterface extends AENetworkInvTile implements IGridTickable, IT
}
@Override
public IStorageMonitorable getMonitorable( ForgeDirection side, BaseActionSource src )
public IStorageMonitorable getMonitorable( final ForgeDirection side, final BaseActionSource src )
{
return this.duality.getMonitorable( side, src, this );
}
@@ -271,7 +271,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 );
}
@@ -283,13 +283,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 );
}
@@ -301,13 +301,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 );
}
@@ -319,7 +319,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 );
}
@@ -49,7 +49,7 @@ public class TileLightDetector extends AEBaseTile
public void updateLight()
{
int val = this.worldObj.getBlockLightValue( this.xCoord, this.yCoord, this.zCoord );
final int val = this.worldObj.getBlockLightValue( this.xCoord, this.yCoord, this.zCoord );
if( this.lastLight != val )
{
+23 -23
View File
@@ -54,9 +54,9 @@ public class TilePaint extends AEBaseTile
List<Splotch> dots = null;
@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() )
{
@@ -64,7 +64,7 @@ public class TilePaint extends AEBaseTile
}
}
void writeBuffer( ByteBuf out )
void writeBuffer( final ByteBuf out )
{
if( this.dots == null )
{
@@ -74,14 +74,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" ) )
{
@@ -89,9 +89,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 )
{
@@ -107,7 +107,7 @@ public class TilePaint extends AEBaseTile
}
this.isLit = 0;
for( Splotch s : this.dots )
for( final Splotch s : this.dots )
{
if( s.lumen )
{
@@ -132,13 +132,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;
@@ -151,7 +151,7 @@ public class TilePaint extends AEBaseTile
return;
}
for( ForgeDirection side : ForgeDirection.VALID_DIRECTIONS )
for( final ForgeDirection side : ForgeDirection.VALID_DIRECTIONS )
{
if( !this.isSideValid( side ) )
{
@@ -162,18 +162,18 @@ public class TilePaint extends AEBaseTile
this.updateData();
}
public boolean isSideValid( ForgeDirection side )
public boolean isSideValid( final ForgeDirection side )
{
Block blk = this.worldObj.getBlock( this.xCoord + side.offsetX, this.yCoord + side.offsetY, this.zCoord + side.offsetZ );
final Block blk = this.worldObj.getBlock( this.xCoord + side.offsetX, this.yCoord + side.offsetY, this.zCoord + side.offsetZ );
return blk.isSideSolid( this.worldObj, this.xCoord + side.offsetX, this.yCoord + side.offsetY, this.zCoord + side.offsetZ, side.getOpposite() );
}
private void removeSide( ForgeDirection side )
private void removeSide( final ForgeDirection 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();
@@ -187,7 +187,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 )
{
@@ -208,7 +208,7 @@ public class TilePaint extends AEBaseTile
}
}
public void cleanSide( ForgeDirection side )
public void cleanSide( final ForgeDirection side )
{
if( this.dots == null )
{
@@ -225,15 +225,15 @@ public class TilePaint extends AEBaseTile
return this.isLit;
}
public void addBlot( ItemStack type, ForgeDirection side, Vec3 hitVec )
public void addBlot( final ItemStack type, final ForgeDirection side, final Vec3 hitVec )
{
Block blk = this.worldObj.getBlock( this.xCoord + side.offsetX, this.yCoord + side.offsetY, this.zCoord + side.offsetZ );
final Block blk = this.worldObj.getBlock( this.xCoord + side.offsetX, this.yCoord + side.offsetY, this.zCoord + side.offsetZ );
if( blk.isSideSolid( this.worldObj, this.xCoord + side.offsetX, this.yCoord + side.offsetY, this.zCoord + side.offsetZ, 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( ForgeDirection dir )
public AECableType getCableConnectionType( final ForgeDirection 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( ForgeDirection inForward, ForgeDirection inUp )
public void setOrientation( final ForgeDirection inForward, final ForgeDirection 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;
}
@@ -108,20 +108,20 @@ 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, int x, int y, int z, List<ItemStack> drops )
public void getDrops( final World w, final int x, final int y, final int z, 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() );
}
@@ -133,26 +133,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() );
@@ -160,12 +160,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++;
@@ -175,7 +175,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" ) )
@@ -186,10 +186,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.func_150296_c() )
final NBTTagCompound storedItems = data.getCompoundTag( "storedItems" );
for( final Object key : storedItems.func_150296_c() )
{
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 ) ) );
@@ -204,26 +204,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( ForgeDirection dir )
public AECableType getCableConnectionType( final ForgeDirection dir )
{
return AECableType.SMART;
}
@@ -296,7 +296,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 )
{
}
@@ -308,18 +308,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 );
}
}
@@ -347,7 +347,7 @@ public class TileSecurity extends AENetworkTile implements ITerminalHost, IAEApp
}
@Override
public boolean recolourBlock( ForgeDirection side, AEColor newPaintedColor, EntityPlayer who )
public boolean recolourBlock( final ForgeDirection 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( ForgeDirection dir )
public AECableType getCableConnectionType( final ForgeDirection 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, int side )
public boolean canExtractItem( final int slotIndex, final ItemStack extractedItem, final int side )
{
return extractedItem.getItem() == Items.bucket;
}
@Override
public int[] getAccessibleSlotsBySide( ForgeDirection side )
public int[] getAccessibleSlotsBySide( final ForgeDirection 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!
}