Reduce scope of variables

This commit is contained in:
thatsIch
2015-09-25 22:52:41 +02:00
parent f4ff28d2a6
commit 0387d30d1c
78 changed files with 174 additions and 218 deletions
@@ -475,7 +475,6 @@ public abstract class AEBaseContainer extends Container
return null;
}
ItemStack tis = null;
AppEngSlot clickSlot = (AppEngSlot) this.inventorySlots.get( idx ); // require AE SLots!
if( clickSlot instanceof SlotDisabled || clickSlot instanceof SlotInaccessible )
@@ -484,7 +483,7 @@ public abstract class AEBaseContainer extends Container
}
if( clickSlot != null && clickSlot.getHasStack() )
{
tis = clickSlot.getStack();
ItemStack tis = clickSlot.getStack();
if( tis == null )
{
@@ -91,9 +91,6 @@ public class ContainerCellWorkbench extends ContainerUpgradeable
@Override
protected void setupConfig()
{
int x = 8;
int y = 29;
int offset = 0;
IInventory cell = this.upgradeable.getInventoryByName( "cell" );
this.addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.WORKBENCH_CELL, cell, 0, 152, 8, this.invPlayer ) );
@@ -102,6 +99,9 @@ public class ContainerCellWorkbench extends ContainerUpgradeable
IInventory upgradeInventory = new Upgrades();
// null, 3 * 8 );
int offset = 0;
int y = 29;
int x = 8;
for( int w = 0; w < 7; w++ )
{
for( int z = 0; z < 9; z++ )
@@ -217,7 +217,6 @@ public class ContainerCraftConfirm extends AEBaseContainer
for( IAEItemStack out : plan )
{
IAEItemStack m = null;
IAEItemStack o = out.copy();
o.reset();
@@ -230,6 +229,7 @@ public class ContainerCraftConfirm extends AEBaseContainer
IStorageGrid sg = this.getGrid().getCache( IStorageGrid.class );
IMEInventory<IAEItemStack> items = sg.getItemInventory();
IAEItemStack m = null;
if( c != null && this.result.isSimulation() )
{
m = o.copy();
@@ -153,7 +153,6 @@ public class ContainerInscriber extends ContainerUpgradeable implements IProgres
if( ( s == this.top && bot != null ) || ( s == this.bottom && top != null ) )
{
boolean isValid = false;
ItemStack otherSlot = null;
if( s == this.top )
{
@@ -172,6 +171,7 @@ public class ContainerInscriber extends ContainerUpgradeable implements IProgres
}
// everything else
boolean isValid = false;
for( IInscriberRecipe recipe : AEApi.instance().registries().inscriber().getRecipes() )
{
if( Platform.isSameItemPrecise( recipe.getTopOptional().orNull(), otherSlot ) )
@@ -76,8 +76,6 @@ public class ContainerLevelEmitter extends ContainerUpgradeable
@Override
protected void setupConfig()
{
int x = 80 + 44;
int y = 40;
IInventory upgrades = this.upgradeable.getInventoryByName( "upgrades" );
if( this.availableUpgrades() > 0 )
@@ -98,6 +96,8 @@ public class ContainerLevelEmitter extends ContainerUpgradeable
}
IInventory inv = this.upgradeable.getInventoryByName( "config" );
int y = 40;
int x = 80 + 44;
this.addSlotToContainer( new SlotFakeTypeOnly( inv, 0, x, y ) );
}
@@ -107,10 +107,9 @@ public class ContainerNetworkStatus extends AEBaseContainer
this.maxPower = (long) ( 100.0 * eg.getMaxStoredPower() );
}
PacketMEInventoryUpdate piu;
try
{
piu = new PacketMEInventoryUpdate();
PacketMEInventoryUpdate piu = new PacketMEInventoryUpdate();
for( Class<? extends IGridHost> machineClass : this.network.getMachinesClasses() )
{
@@ -133,11 +133,11 @@ public class ContainerUpgradeable extends AEBaseContainer implements IOptionalSl
protected void setupConfig()
{
int x = 80;
int y = 40;
this.setupUpgrades();
IInventory inv = this.upgradeable.getInventoryByName( "config" );
int y = 40;
int x = 80;
this.addSlotToContainer( new SlotFakeTypeOnly( inv, 0, x, y ) );
if( this.supportCapacity() )