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
@@ -69,23 +69,23 @@ public class TileCableBus extends AEBaseTile implements AEMultiTile, ICustomColl
private int oldLV = -1; // on re-calculate light when it changes
@TileEvent( TileEventType.WORLD_NBT_READ )
public void readFromNBT_TileCableBus( NBTTagCompound data )
public void readFromNBT_TileCableBus( final NBTTagCompound data )
{
this.cb.readFromNBT( data );
}
@TileEvent( TileEventType.WORLD_NBT_WRITE )
public void writeToNBT_TileCableBus( NBTTagCompound data )
public void writeToNBT_TileCableBus( final NBTTagCompound data )
{
this.cb.writeToNBT( data );
}
@TileEvent( TileEventType.NETWORK_READ )
public boolean readFromStream_TileCableBus( ByteBuf data ) throws IOException
public boolean readFromStream_TileCableBus( final ByteBuf data ) throws IOException
{
boolean ret = this.cb.readFromStream( data );
final boolean ret = this.cb.readFromStream( data );
int newLV = this.cb.getLightValue();
final int newLV = this.cb.getLightValue();
if( newLV != this.oldLV )
{
this.oldLV = newLV;
@@ -102,27 +102,27 @@ public class TileCableBus extends AEBaseTile implements AEMultiTile, ICustomColl
{
try
{
TileCableBus tcb = (TileCableBus) BlockCableBus.tesrTile.newInstance();
final TileCableBus tcb = (TileCableBus) BlockCableBus.tesrTile.newInstance();
tcb.copyFrom( this );
this.getWorld().setTileEntity( pos, tcb );
}
catch( Throwable ignored )
catch( final Throwable ignored )
{
}
}
}
protected void copyFrom( TileCableBus oldTile )
protected void copyFrom( final TileCableBus oldTile )
{
CableBusContainer tmpCB = this.cb;
final CableBusContainer tmpCB = this.cb;
this.cb = oldTile.cb;
this.oldLV = oldTile.oldLV;
oldTile.cb = tmpCB;
}
@TileEvent( TileEventType.NETWORK_WRITE )
public void writeToStream_TileCableBus( ByteBuf data ) throws IOException
public void writeToStream_TileCableBus( final ByteBuf data ) throws IOException
{
this.cb.writeToStream( data );
}
@@ -148,13 +148,13 @@ public class TileCableBus extends AEBaseTile implements AEMultiTile, ICustomColl
}
@Override
public IGridNode getGridNode( AEPartLocation dir )
public IGridNode getGridNode( final AEPartLocation dir )
{
return this.cb.getGridNode( dir );
}
@Override
public AECableType getCableConnectionType( AEPartLocation side )
public AECableType getCableConnectionType( final AEPartLocation side )
{
return this.cb.getCableConnectionType( side );
}
@@ -174,7 +174,7 @@ public class TileCableBus extends AEBaseTile implements AEMultiTile, ICustomColl
return;
}
int newLV = this.cb.getLightValue();
final int newLV = this.cb.getLightValue();
if( newLV != this.oldLV )
{
this.oldLV = newLV;
@@ -192,13 +192,13 @@ public class TileCableBus extends AEBaseTile implements AEMultiTile, ICustomColl
}
@Override
public void getDrops( World w, BlockPos pos, List drops )
public void getDrops( final World w, final BlockPos pos, final List drops )
{
this.cb.getDrops( drops );
}
@Override
public void getNoDrops( World w, BlockPos pos, List<ItemStack> drops )
public void getNoDrops( final World w, final BlockPos pos, final List<ItemStack> drops )
{
this.cb.getNoDrops( drops );
}
@@ -233,31 +233,31 @@ public class TileCableBus extends AEBaseTile implements AEMultiTile, ICustomColl
}
@Override
public boolean canAddPart( ItemStack is, AEPartLocation side )
public boolean canAddPart( final ItemStack is, final AEPartLocation side )
{
return this.cb.canAddPart( is, side );
}
@Override
public AEPartLocation addPart( ItemStack is, AEPartLocation side, EntityPlayer player )
public AEPartLocation addPart( final ItemStack is, final AEPartLocation side, final EntityPlayer player )
{
return this.cb.addPart( is, side, player );
}
@Override
public IPart getPart( AEPartLocation side )
public IPart getPart( final AEPartLocation side )
{
return this.cb.getPart( side );
}
@Override
public IPart getPart( EnumFacing side )
public IPart getPart( final EnumFacing side )
{
return this.cb.getPart( side );
}
@Override
public void removePart( AEPartLocation side, boolean suppressUpdate )
public void removePart( final AEPartLocation side, final boolean suppressUpdate )
{
this.cb.removePart( side, suppressUpdate );
}
@@ -281,19 +281,19 @@ public class TileCableBus extends AEBaseTile implements AEMultiTile, ICustomColl
}
@Override
public boolean isBlocked( EnumFacing side )
public boolean isBlocked( final EnumFacing side )
{
return !this.ImmibisMicroblocks_isSideOpen( side );
}
@Override
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool( World w, BlockPos pos, Entity e, boolean visual )
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool( final World w, final BlockPos pos, final Entity e, final boolean visual )
{
return this.cb.getSelectedBoundingBoxesFromPool( false, true, e, visual );
}
@Override
public SelectedPart selectPart( Vec3 pos )
public SelectedPart selectPart( final Vec3 pos )
{
return this.cb.selectPart( pos );
}
@@ -311,7 +311,7 @@ public class TileCableBus extends AEBaseTile implements AEMultiTile, ICustomColl
}
@Override
public boolean hasRedstone( AEPartLocation side )
public boolean hasRedstone( final AEPartLocation side )
{
return this.cb.hasRedstone( side );
}
@@ -333,7 +333,7 @@ public class TileCableBus extends AEBaseTile implements AEMultiTile, ICustomColl
{
if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.ImmibisMicroblocks ) )
{
IImmibisMicroblocks imb = (IImmibisMicroblocks) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.ImmibisMicroblocks );
final IImmibisMicroblocks imb = (IImmibisMicroblocks) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.ImmibisMicroblocks );
if( imb != null && imb.leaveParts( this ) )
{
return;
@@ -345,13 +345,13 @@ public class TileCableBus extends AEBaseTile implements AEMultiTile, ICustomColl
@Override
public void addCollidingBlockToList(
World w,
BlockPos pos,
AxisAlignedBB bb,
List<AxisAlignedBB> out,
Entity e )
final World w,
final BlockPos pos,
final AxisAlignedBB bb,
final List<AxisAlignedBB> out,
final Entity e )
{
for( AxisAlignedBB bx : this.getSelectedBoundingBoxesFromPool( w, pos, e, false ) )
for( final AxisAlignedBB bx : this.getSelectedBoundingBoxesFromPool( w, pos, e, false ) )
{
out.add( AxisAlignedBB.fromBounds( bx.minX, bx.minY, bx.minZ, bx.maxX, bx.maxY, bx.maxZ ) );
}
@@ -372,7 +372,7 @@ public class TileCableBus extends AEBaseTile implements AEMultiTile, ICustomColl
return this.cb.isInWorld();
}
public boolean ImmibisMicroblocks_isSideOpen( EnumFacing side )
public boolean ImmibisMicroblocks_isSideOpen( final EnumFacing side )
{
return true;
}
@@ -384,9 +384,9 @@ public class TileCableBus extends AEBaseTile implements AEMultiTile, ICustomColl
@Override
public boolean recolourBlock(
EnumFacing side,
AEColor colour,
EntityPlayer who )
final EnumFacing side,
final AEColor colour,
final EntityPlayer who )
{
return this.cb.recolourBlock( side, colour, who );
}
@@ -32,11 +32,11 @@ public class TileCableBusTESR extends TileCableBus
{
try
{
TileCableBus tcb = (TileCableBus) BlockCableBus.noTesrTile.newInstance();
final TileCableBus tcb = (TileCableBus) BlockCableBus.noTesrTile.newInstance();
tcb.copyFrom( this );
this.getWorld().setTileEntity( pos, tcb );
}
catch( Throwable ignored )
catch( final Throwable ignored )
{
}
@@ -59,7 +59,7 @@ public class TileController extends AENetworkPowerTile
}
@Override
public AECableType getCableConnectionType( AEPartLocation dir )
public AECableType getCableConnectionType( final AEPartLocation dir )
{
return AECableType.DENSE;
}
@@ -71,7 +71,7 @@ public class TileController extends AENetworkPowerTile
super.onReady();
}
public void onNeighborChange( boolean force )
public void onNeighborChange( final boolean force )
{
final boolean xx = checkController( pos.offset( EnumFacing.EAST ) ) && checkController( pos.offset( EnumFacing.WEST ) );
final boolean yy = checkController( pos.offset( EnumFacing.UP ) ) && checkController( pos.offset( EnumFacing.DOWN ) );
@@ -122,7 +122,7 @@ public class TileController extends AENetworkPowerTile
}
}
}
catch( GridAccessException e )
catch( final GridAccessException e )
{
metaState = ControllerBlockState.OFFLINE;
}
@@ -135,13 +135,13 @@ public class TileController extends AENetworkPowerTile
}
@Override
protected double getFunnelPowerDemand( double maxReceived )
protected double getFunnelPowerDemand( final double maxReceived )
{
try
{
return this.gridProxy.getEnergy().getEnergyDemand( 8000 );
}
catch( GridAccessException e )
catch( final GridAccessException e )
{
// no grid? use local...
return super.getFunnelPowerDemand( maxReceived );
@@ -149,18 +149,18 @@ public class TileController extends AENetworkPowerTile
}
@Override
protected double funnelPowerIntoStorage( double power, Actionable mode )
protected double funnelPowerIntoStorage( final double power, final Actionable mode )
{
try
{
double ret = this.gridProxy.getEnergy().injectPower( power, mode );
final double ret = this.gridProxy.getEnergy().injectPower( power, mode );
if( mode == Actionable.SIMULATE )
{
return ret;
}
return 0;
}
catch( GridAccessException e )
catch( final GridAccessException e )
{
// no grid? use local...
return super.funnelPowerIntoStorage( power, mode );
@@ -168,26 +168,26 @@ public class TileController extends AENetworkPowerTile
}
@Override
protected void PowerEvent( PowerEventType x )
protected void PowerEvent( final PowerEventType x )
{
try
{
this.gridProxy.getGrid().postEvent( new MENetworkPowerStorage( this, x ) );
}
catch( GridAccessException e )
catch( final GridAccessException e )
{
// not ready!
}
}
@MENetworkEventSubscribe
public void onControllerChange( MENetworkControllerChange status )
public void onControllerChange( final MENetworkControllerChange status )
{
this.updateMeta();
}
@MENetworkEventSubscribe
public void onPowerChange( MENetworkPowerStatusChange status )
public void onPowerChange( final MENetworkPowerStatusChange status )
{
this.updateMeta();
}
@@ -199,13 +199,13 @@ public class TileController extends AENetworkPowerTile
}
@Override
public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removed, ItemStack added )
public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removed, final ItemStack added )
{
}
@Override
public int[] getAccessibleSlotsBySide( EnumFacing whichSide )
public int[] getAccessibleSlotsBySide( final EnumFacing whichSide )
{
return ACCESSIBLE_SLOTS_BY_SIDE;
}
@@ -215,7 +215,7 @@ public class TileController extends AENetworkPowerTile
*
* @return true if there is a loaded controller
*/
private boolean checkController( BlockPos pos )
private boolean checkController( final BlockPos pos )
{
final BlockPos ownPos = this.getPos();
if( this.worldObj.getChunkProvider().chunkExists( ownPos.getX() >> 4, ownPos.getZ() >> 4 ) )
@@ -37,13 +37,13 @@ public class TileCreativeEnergyCell extends AENetworkTile implements IAEPowerSto
}
@Override
public AECableType getCableConnectionType( AEPartLocation dir )
public AECableType getCableConnectionType( final AEPartLocation dir )
{
return AECableType.COVERED;
}
@Override
public double injectAEPower( double amt, Actionable mode )
public double injectAEPower( final double amt, final Actionable mode )
{
return 0;
}
@@ -73,7 +73,7 @@ public class TileCreativeEnergyCell extends AENetworkTile implements IAEPowerSto
}
@Override
public double extractAEPower( double amt, Actionable mode, PowerMultiplier pm )
public double extractAEPower( final double amt, final Actionable mode, final PowerMultiplier pm )
{
return amt;
}
@@ -46,7 +46,7 @@ public class TileEnergyAcceptor extends AENetworkPowerTile
}
@Override
public void readFromNBT_AENetwork( NBTTagCompound data )
public void readFromNBT_AENetwork( final NBTTagCompound data )
{
/**
* Does nothing here since the NBT tag in the parent is not needed anymore
@@ -54,7 +54,7 @@ public class TileEnergyAcceptor extends AENetworkPowerTile
}
@Override
public void writeToNBT_AENetwork( NBTTagCompound data )
public void writeToNBT_AENetwork( final NBTTagCompound data )
{
/**
* Does nothing here since the NBT tag in the parent is not needed anymore
@@ -62,39 +62,39 @@ public class TileEnergyAcceptor extends AENetworkPowerTile
}
@Override
public AECableType getCableConnectionType( AEPartLocation dir )
public AECableType getCableConnectionType( final AEPartLocation dir )
{
return AECableType.COVERED;
}
@Override
protected double getFunnelPowerDemand( double maxRequired )
protected double getFunnelPowerDemand( final double maxRequired )
{
try
{
IEnergyGrid grid = this.gridProxy.getEnergy();
final IEnergyGrid grid = this.gridProxy.getEnergy();
return grid.getEnergyDemand( maxRequired );
}
catch( GridAccessException e )
catch( final GridAccessException e )
{
return this.internalMaxPower;
}
}
@Override
protected double funnelPowerIntoStorage( double power, Actionable mode )
protected double funnelPowerIntoStorage( final double power, final Actionable mode )
{
try
{
IEnergyGrid grid = this.gridProxy.getEnergy();
double leftOver = grid.injectPower( power, mode );
final IEnergyGrid grid = this.gridProxy.getEnergy();
final double leftOver = grid.injectPower( power, mode );
if( mode == Actionable.SIMULATE )
{
return leftOver;
}
return 0.0;
}
catch( GridAccessException e )
catch( final GridAccessException e )
{
return super.funnelPowerIntoStorage( power, mode );
}
@@ -107,13 +107,13 @@ public class TileEnergyAcceptor extends AENetworkPowerTile
}
@Override
public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removed, ItemStack added )
public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removed, final ItemStack added )
{
}
@Override
public int[] getAccessibleSlotsBySide( EnumFacing side )
public int[] getAccessibleSlotsBySide( final EnumFacing side )
{
return this.sides;
}
@@ -51,7 +51,7 @@ public class TileEnergyCell extends AENetworkTile implements IAEPowerStorage
}
@Override
public AECableType getCableConnectionType( AEPartLocation dir )
public AECableType getCableConnectionType( final AEPartLocation dir )
{
return AECableType.COVERED;
}
@@ -60,7 +60,7 @@ public class TileEnergyCell extends AENetworkTile implements IAEPowerStorage
public void onReady()
{
super.onReady();
int value = ( Integer ) this.worldObj.getBlockState( pos ).getValue( BlockEnergyCell.ENERGY_STORAGE );
final int value = ( Integer ) this.worldObj.getBlockState( pos ).getValue( BlockEnergyCell.ENERGY_STORAGE );
currentMeta = (byte)value;
this.changePowerLevel();
}
@@ -91,7 +91,7 @@ public class TileEnergyCell extends AENetworkTile implements IAEPowerStorage
}
@TileEvent( TileEventType.WORLD_NBT_WRITE )
public void writeToNBT_TileEnergyCell( NBTTagCompound data )
public void writeToNBT_TileEnergyCell( final NBTTagCompound data )
{
if( !this.worldObj.isRemote )
{
@@ -100,7 +100,7 @@ public class TileEnergyCell extends AENetworkTile implements IAEPowerStorage
}
@TileEvent( TileEventType.WORLD_NBT_READ )
public void readFromNBT_TileEnergyCell( NBTTagCompound data )
public void readFromNBT_TileEnergyCell( final NBTTagCompound data )
{
this.internalCurrentPower = data.getDouble( "internalCurrentPower" );
}
@@ -112,7 +112,7 @@ public class TileEnergyCell extends AENetworkTile implements IAEPowerStorage
}
@Override
public void uploadSettings( SettingsFrom from, NBTTagCompound compound )
public void uploadSettings( final SettingsFrom from, final NBTTagCompound compound )
{
if( from == SettingsFrom.DISMANTLE_ITEM )
{
@@ -121,11 +121,11 @@ public class TileEnergyCell extends AENetworkTile implements IAEPowerStorage
}
@Override
public NBTTagCompound downloadSettings( SettingsFrom from )
public NBTTagCompound downloadSettings( final SettingsFrom from )
{
if( from == SettingsFrom.DISMANTLE_ITEM )
{
NBTTagCompound tag = new NBTTagCompound();
final NBTTagCompound tag = new NBTTagCompound();
tag.setDouble( "internalCurrentPower", this.internalCurrentPower );
tag.setDouble( "internalMaxPower", this.internalMaxPower ); // used for tool tip.
return tag;
@@ -134,11 +134,11 @@ public class TileEnergyCell extends AENetworkTile implements IAEPowerStorage
}
@Override
public final double injectAEPower( double amt, Actionable mode )
public final double injectAEPower( double amt, final Actionable mode )
{
if( mode == Actionable.SIMULATE )
{
double fakeBattery = this.internalCurrentPower + amt;
final double fakeBattery = this.internalCurrentPower + amt;
if( fakeBattery > this.internalMaxPower )
{
return fakeBattery - this.internalMaxPower;
@@ -191,12 +191,12 @@ public class TileEnergyCell extends AENetworkTile implements IAEPowerStorage
}
@Override
public final double extractAEPower( double amt, Actionable mode, PowerMultiplier pm )
public final double extractAEPower( final double amt, final Actionable mode, final PowerMultiplier pm )
{
return pm.divide( this.extractAEPower( pm.multiply( amt ), mode ) );
}
private double extractAEPower( double amt, Actionable mode )
private double extractAEPower( double amt, final Actionable mode )
{
if( mode == Actionable.SIMULATE )
{
@@ -207,7 +207,7 @@ public class TileEnergyCell extends AENetworkTile implements IAEPowerStorage
return this.internalCurrentPower;
}
boolean wasFull = this.internalCurrentPower >= this.internalMaxPower - 0.001;
final boolean wasFull = this.internalCurrentPower >= this.internalMaxPower - 0.001;
if( wasFull && amt > 0.001 )
{
@@ -215,7 +215,7 @@ public class TileEnergyCell extends AENetworkTile implements IAEPowerStorage
{
this.gridProxy.getGrid().postEvent( new MENetworkPowerStorage( this, PowerEventType.REQUEST_POWER ) );
}
catch( GridAccessException ignored )
catch( final GridAccessException ignored )
{
}
@@ -65,35 +65,35 @@ public class TileWireless extends AENetworkInvTile implements IWirelessAccessPoi
}
@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.getForward().getOpposite() ) );
}
@MENetworkEventSubscribe
public void chanRender( MENetworkChannelsChanged c )
public void chanRender( final MENetworkChannelsChanged c )
{
this.markForUpdate();
}
@MENetworkEventSubscribe
public void powerRender( MENetworkPowerStatusChange c )
public void powerRender( final MENetworkPowerStatusChange c )
{
this.markForUpdate();
}
@TileEvent( TileEventType.NETWORK_READ )
public boolean readFromStream_TileWireless( ByteBuf data )
public boolean readFromStream_TileWireless( final ByteBuf data )
{
int old = this.clientFlags;
final int old = this.clientFlags;
this.clientFlags = data.readByte();
return old != this.clientFlags;
}
@TileEvent( TileEventType.NETWORK_WRITE )
public void writeToStream_TileWireless( ByteBuf data )
public void writeToStream_TileWireless( final ByteBuf data )
{
this.clientFlags = 0;
@@ -109,7 +109,7 @@ public class TileWireless extends AENetworkInvTile implements IWirelessAccessPoi
this.clientFlags |= CHANNEL_FLAG;
}
}
catch( GridAccessException e )
catch( final GridAccessException e )
{
// meh
}
@@ -118,7 +118,7 @@ public class TileWireless extends AENetworkInvTile implements IWirelessAccessPoi
}
@Override
public AECableType getCableConnectionType( AEPartLocation dir )
public AECableType getCableConnectionType( final AEPartLocation dir )
{
return AECableType.SMART;
}
@@ -136,19 +136,19 @@ public class TileWireless extends AENetworkInvTile implements IWirelessAccessPoi
}
@Override
public boolean isItemValidForSlot( int i, ItemStack itemstack )
public boolean isItemValidForSlot( final int i, final ItemStack itemstack )
{
return AEApi.instance().definitions().materials().wirelessBooster().isSameAs( itemstack );
}
@Override
public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removed, ItemStack added )
public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removed, final ItemStack added )
{
// :P
}
@Override
public int[] getAccessibleSlotsBySide( EnumFacing side )
public int[] getAccessibleSlotsBySide( final EnumFacing side )
{
return this.sides;
}
@@ -167,7 +167,7 @@ public class TileWireless extends AENetworkInvTile implements IWirelessAccessPoi
private int getBoosters()
{
ItemStack boosters = this.inv.getStackInSlot( 0 );
final ItemStack boosters = this.inv.getStackInSlot( 0 );
return boosters == null ? 0 : boosters.stackSize;
}
@@ -201,7 +201,7 @@ public class TileWireless extends AENetworkInvTile implements IWirelessAccessPoi
{
return this.gridProxy.getGrid();
}
catch( GridAccessException e )
catch( final GridAccessException e )
{
return null;
}