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
+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 );