Final fields, params and variables

This commit is contained in:
yueh
2015-12-24 02:09:38 +01:00
parent 99215e1701
commit a6ee559723
21 changed files with 89 additions and 89 deletions
@@ -38,14 +38,14 @@ public class InvLayerData
private final List<ISidedInventory> inventories;
private final List<InvSot> slots;
public InvLayerData( int[][] a, List<ISidedInventory> b, List<InvSot> c )
public InvLayerData( final int[][] a, final List<ISidedInventory> b, final List<InvSot> c )
{
this.sides = a;
this.inventories = b;
this.slots = c;
}
public ItemStack decreaseStackSize( int slot, int amount )
public ItemStack decreaseStackSize( final int slot, final int amount )
{
if( this.isSlotValid( slot ) )
{
@@ -62,7 +62,7 @@ public class InvLayerData
*
* @return true, if the slot exists.
*/
boolean isSlotValid( int slot )
boolean isSlotValid( final int slot )
{
return this.slots != null && slot >= 0 && slot < this.slots.size();
}
@@ -77,7 +77,7 @@ public class InvLayerData
return this.slots.size();
}
public ItemStack getStackInSlot( int slot )
public ItemStack getStackInSlot( final int slot )
{
if( this.isSlotValid( slot ) )
{
@@ -87,7 +87,7 @@ public class InvLayerData
return null;
}
public boolean isItemValidForSlot( int slot, ItemStack itemstack )
public boolean isItemValidForSlot( final int slot, final ItemStack itemstack )
{
if( this.isSlotValid( slot ) )
{
@@ -97,7 +97,7 @@ public class InvLayerData
return false;
}
public void setInventorySlotContents( int slot, ItemStack itemstack )
public void setInventorySlotContents( final int slot, final ItemStack itemstack )
{
if( this.isSlotValid( slot ) )
{
@@ -105,7 +105,7 @@ public class InvLayerData
}
}
public boolean canExtractItem( int slot, ItemStack itemstack, EnumFacing side )
public boolean canExtractItem( final int slot, final ItemStack itemstack, final EnumFacing side )
{
if( this.isSlotValid( slot ) )
{
@@ -115,7 +115,7 @@ public class InvLayerData
return false;
}
public boolean canInsertItem( int slot, ItemStack itemstack, EnumFacing side )
public boolean canInsertItem( final int slot, final ItemStack itemstack, final EnumFacing side )
{
if( this.isSlotValid( slot ) )
{
@@ -129,14 +129,14 @@ public class InvLayerData
{
if( this.inventories != null )
{
for( IInventory inv : this.inventories )
for( final IInventory inv : this.inventories )
{
inv.markDirty();
}
}
}
public int[] getSlotsForFace( EnumFacing side )
public int[] getSlotsForFace( final EnumFacing side )
{
if( this.sides == null || side == null )
{
@@ -30,13 +30,13 @@ public class InvSot
private final ISidedInventory partInv;
private final int index;
public InvSot( ISidedInventory part, int slot )
public InvSot( final ISidedInventory part, final int slot )
{
this.partInv = part;
this.index = slot;
}
public ItemStack decreaseStackSize( int j )
public ItemStack decreaseStackSize( final int j )
{
return this.partInv.decrStackSize( this.index, j );
}
@@ -46,22 +46,22 @@ public class InvSot
return this.partInv.getStackInSlot( this.index );
}
public boolean isItemValidForSlot( ItemStack itemstack )
public boolean isItemValidForSlot( final ItemStack itemstack )
{
return this.partInv.isItemValidForSlot( this.index, itemstack );
}
public void setInventorySlotContents( ItemStack itemstack )
public void setInventorySlotContents( final ItemStack itemstack )
{
this.partInv.setInventorySlotContents( this.index, itemstack );
}
public boolean canExtractItem( ItemStack itemstack, EnumFacing side )
public boolean canExtractItem( final ItemStack itemstack, final EnumFacing side )
{
return this.partInv.canExtractItem( this.index, itemstack, side );
}
public boolean canInsertItem( ItemStack itemstack, EnumFacing side )
public boolean canInsertItem( final ItemStack itemstack, final EnumFacing side )
{
return this.partInv.canInsertItem( this.index, itemstack, side );
}
@@ -68,12 +68,12 @@ public class LayerISidedInventory extends LayerBase implements ISidedInventory
inventories = new ArrayList<ISidedInventory>();
int slotCount = 0;
for( AEPartLocation side : AEPartLocation.SIDE_LOCATIONS )
for( final AEPartLocation side : AEPartLocation.SIDE_LOCATIONS )
{
IPart bp = this.getPart( side );
final IPart bp = this.getPart( side );
if( bp instanceof ISidedInventory )
{
ISidedInventory part = (ISidedInventory) bp;
final ISidedInventory part = (ISidedInventory) bp;
slotCount += part.getSizeInventory();
inventories.add( part );
}
@@ -90,13 +90,13 @@ public class LayerISidedInventory extends LayerBase implements ISidedInventory
int offsetForLayer = 0;
int offsetForPart = 0;
for( ISidedInventory sides : inventories )
for( final ISidedInventory sides : inventories )
{
offsetForPart = 0;
slotCount = sides.getSizeInventory();
AEPartLocation currentSide = AEPartLocation.INTERNAL;
for( AEPartLocation side : AEPartLocation.SIDE_LOCATIONS )
for( final AEPartLocation side : AEPartLocation.SIDE_LOCATIONS )
{
if( this.getPart( side ) == sides )
{
@@ -105,7 +105,7 @@ public class LayerISidedInventory extends LayerBase implements ISidedInventory
}
}
int[] cSidesList = sideData[currentSide.ordinal()] = new int[slotCount];
final int[] cSidesList = sideData[currentSide.ordinal()] = new int[slotCount];
for( int cSlot = 0; cSlot < slotCount; cSlot++ )
{
cSidesList[cSlot] = offsetForLayer;
@@ -141,7 +141,7 @@ public class LayerISidedInventory extends LayerBase implements ISidedInventory
}
@Override
public ItemStack getStackInSlot( int slot )
public ItemStack getStackInSlot( final int slot )
{
if( this.invLayer == null )
{
@@ -152,7 +152,7 @@ public class LayerISidedInventory extends LayerBase implements ISidedInventory
}
@Override
public ItemStack decrStackSize( int slot, int amount )
public ItemStack decrStackSize( final int slot, final int amount )
{
if( this.invLayer == null )
{
@@ -163,13 +163,13 @@ public class LayerISidedInventory extends LayerBase implements ISidedInventory
}
@Override
public ItemStack getStackInSlotOnClosing( int slot )
public ItemStack getStackInSlotOnClosing( final int slot )
{
return null;
}
@Override
public void setInventorySlotContents( int slot, ItemStack itemstack )
public void setInventorySlotContents( final int slot, final ItemStack itemstack )
{
if( this.invLayer == null )
{
@@ -198,23 +198,23 @@ public class LayerISidedInventory extends LayerBase implements ISidedInventory
}
@Override
public boolean isUseableByPlayer( EntityPlayer entityplayer )
public boolean isUseableByPlayer( final EntityPlayer entityplayer )
{
return false;
}
@Override
public void openInventory( EntityPlayer player )
public void openInventory( final EntityPlayer player )
{
}
@Override
public void closeInventory( EntityPlayer player )
public void closeInventory( final EntityPlayer player )
{
}
@Override
public boolean isItemValidForSlot( int slot, ItemStack itemstack )
public boolean isItemValidForSlot( final int slot, final ItemStack itemstack )
{
if( this.invLayer == null )
{
@@ -236,7 +236,7 @@ public class LayerISidedInventory extends LayerBase implements ISidedInventory
}
@Override
public int[] getSlotsForFace( EnumFacing side )
public int[] getSlotsForFace( final EnumFacing side )
{
if( this.invLayer != null )
{
@@ -247,7 +247,7 @@ public class LayerISidedInventory extends LayerBase implements ISidedInventory
}
@Override
public boolean canInsertItem( int slot, ItemStack itemstack, EnumFacing side )
public boolean canInsertItem( final int slot, final ItemStack itemstack, final EnumFacing side )
{
if( this.invLayer == null )
{
@@ -258,7 +258,7 @@ public class LayerISidedInventory extends LayerBase implements ISidedInventory
}
@Override
public boolean canExtractItem( int slot, ItemStack itemstack, EnumFacing side )
public boolean canExtractItem( final int slot, final ItemStack itemstack, final EnumFacing side )
{
if( this.invLayer == null )
{
@@ -270,15 +270,15 @@ public class LayerISidedInventory extends LayerBase implements ISidedInventory
@Override
public int getField(
int id )
final int id )
{
return 0;
}
@Override
public void setField(
int id,
int value )
final int id,
final int value )
{
}
@@ -32,9 +32,9 @@ public class LayerITileStorageMonitorable extends LayerBase implements ITileStor
{
@Override
public IStorageMonitorable getMonitorable( EnumFacing side, BaseActionSource src )
public IStorageMonitorable getMonitorable( final EnumFacing side, final BaseActionSource src )
{
IPart part = this.getPart( side );
final IPart part = this.getPart( side );
if( part instanceof ITileStorageMonitorable )
{
return ( (ITileStorageMonitorable) part ).getMonitorable( side, src );
@@ -1060,12 +1060,12 @@ public class PartCable extends AEBasePart implements IPartCable
rh.renderFace( pos, blk.getRendererInstance().getTexture( AEPartLocation.UP ), EnumFacing.UP, renderer );
}
int getChannelsOnSide( int i )
int getChannelsOnSide( final int i )
{
return this.channelsOnSide[i];
}
void setChannelsOnSide( int i, int channels )
void setChannelsOnSide( final int i, final int channels )
{
this.channelsOnSide[i] = channels;
}
@@ -177,7 +177,7 @@ public class PartPatternTerminal extends AbstractPartTerminal
return this.substitute;
}
public void setSubstitution( boolean canSubstitute )
public void setSubstitution( final boolean canSubstitute )
{
this.substitute = canSubstitute;
}