final variables and parameters
This commit is contained in:
@@ -57,15 +57,15 @@ public class ContainerCellWorkbench extends ContainerUpgradeable
|
||||
private int lastUpgrades = 0;
|
||||
private ItemStack LastCell;
|
||||
|
||||
public ContainerCellWorkbench( InventoryPlayer ip, TileCellWorkbench te )
|
||||
public ContainerCellWorkbench( final InventoryPlayer ip, final TileCellWorkbench te )
|
||||
{
|
||||
super( ip, te );
|
||||
this.workBench = te;
|
||||
}
|
||||
|
||||
public void setFuzzy( FuzzyMode valueOf )
|
||||
public void setFuzzy( final FuzzyMode valueOf )
|
||||
{
|
||||
ICellWorkbenchItem cwi = this.workBench.getCell();
|
||||
final ICellWorkbenchItem cwi = this.workBench.getCell();
|
||||
if( cwi != null )
|
||||
{
|
||||
cwi.setFuzzyMode( this.workBench.getInventoryByName( "cell" ).getStackInSlot( 0 ), valueOf );
|
||||
@@ -92,16 +92,16 @@ public class ContainerCellWorkbench extends ContainerUpgradeable
|
||||
protected void setupConfig()
|
||||
{
|
||||
|
||||
IInventory cell = this.upgradeable.getInventoryByName( "cell" );
|
||||
final IInventory cell = this.upgradeable.getInventoryByName( "cell" );
|
||||
this.addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.WORKBENCH_CELL, cell, 0, 152, 8, this.invPlayer ) );
|
||||
|
||||
IInventory inv = this.upgradeable.getInventoryByName( "config" );
|
||||
IInventory upgradeInventory = new Upgrades();
|
||||
final IInventory inv = this.upgradeable.getInventoryByName( "config" );
|
||||
final IInventory upgradeInventory = new Upgrades();
|
||||
// null, 3 * 8 );
|
||||
|
||||
int offset = 0;
|
||||
int y = 29;
|
||||
int x = 8;
|
||||
final int y = 29;
|
||||
final int x = 8;
|
||||
for( int w = 0; w < 7; w++ )
|
||||
{
|
||||
for( int z = 0; z < 9; z++ )
|
||||
@@ -115,7 +115,7 @@ public class ContainerCellWorkbench extends ContainerUpgradeable
|
||||
{
|
||||
for( int z = 0; z < 8; z++ )
|
||||
{
|
||||
int iSLot = zz * 8 + z;
|
||||
final int iSLot = zz * 8 + z;
|
||||
this.addSlotToContainer( new OptionalSlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgradeInventory, this, iSLot, 187 + zz * 18, 8 + 18 * z, iSLot, this.invPlayer ) );
|
||||
}
|
||||
}
|
||||
@@ -132,7 +132,7 @@ public class ContainerCellWorkbench extends ContainerUpgradeable
|
||||
@Override
|
||||
public int availableUpgrades()
|
||||
{
|
||||
ItemStack is = this.workBench.getInventoryByName( "cell" ).getStackInSlot( 0 );
|
||||
final ItemStack is = this.workBench.getInventoryByName( "cell" ).getStackInSlot( 0 );
|
||||
if( this.prevStack != is )
|
||||
{
|
||||
this.prevStack = is;
|
||||
@@ -144,7 +144,7 @@ public class ContainerCellWorkbench extends ContainerUpgradeable
|
||||
@Override
|
||||
public void detectAndSendChanges()
|
||||
{
|
||||
ItemStack is = this.workBench.getInventoryByName( "cell" ).getStackInSlot( 0 );
|
||||
final ItemStack is = this.workBench.getInventoryByName( "cell" ).getStackInSlot( 0 );
|
||||
if( Platform.isServer() )
|
||||
{
|
||||
if( this.workBench.getWorld().getTileEntity( this.workBench.getPos() ) != this.workBench )
|
||||
@@ -152,18 +152,18 @@ public class ContainerCellWorkbench extends ContainerUpgradeable
|
||||
this.isContainerValid = false;
|
||||
}
|
||||
|
||||
for( Object crafter : this.crafters )
|
||||
for( final Object crafter : this.crafters )
|
||||
{
|
||||
ICrafting icrafting = (ICrafting) crafter;
|
||||
final ICrafting icrafting = (ICrafting) crafter;
|
||||
|
||||
if( this.prevStack != is )
|
||||
{
|
||||
// if the bars changed an item was probably made, so just send shit!
|
||||
for( Object s : this.inventorySlots )
|
||||
for( final Object s : this.inventorySlots )
|
||||
{
|
||||
if( s instanceof OptionalSlotRestrictedInput )
|
||||
{
|
||||
OptionalSlotRestrictedInput sri = (OptionalSlotRestrictedInput) s;
|
||||
final OptionalSlotRestrictedInput sri = (OptionalSlotRestrictedInput) s;
|
||||
icrafting.sendSlotContents( this, sri.slotNumber, sri.getStack() );
|
||||
}
|
||||
}
|
||||
@@ -180,7 +180,7 @@ public class ContainerCellWorkbench extends ContainerUpgradeable
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSlotEnabled( int idx )
|
||||
public boolean isSlotEnabled( final int idx )
|
||||
{
|
||||
return idx < this.availableUpgrades();
|
||||
}
|
||||
@@ -193,7 +193,7 @@ public class ContainerCellWorkbench extends ContainerUpgradeable
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate( String field, Object oldValue, Object newValue )
|
||||
public void onUpdate( final String field, final Object oldValue, final Object newValue )
|
||||
{
|
||||
if( field.equals( "copyMode" ) )
|
||||
{
|
||||
@@ -205,7 +205,7 @@ public class ContainerCellWorkbench extends ContainerUpgradeable
|
||||
|
||||
public void clear()
|
||||
{
|
||||
IInventory inv = this.upgradeable.getInventoryByName( "config" );
|
||||
final IInventory inv = this.upgradeable.getInventoryByName( "config" );
|
||||
for( int x = 0; x < inv.getSizeInventory(); x++ )
|
||||
{
|
||||
inv.setInventorySlotContents( x, null );
|
||||
@@ -215,7 +215,7 @@ public class ContainerCellWorkbench extends ContainerUpgradeable
|
||||
|
||||
private FuzzyMode getFuzzyMode()
|
||||
{
|
||||
ICellWorkbenchItem cwi = this.workBench.getCell();
|
||||
final ICellWorkbenchItem cwi = this.workBench.getCell();
|
||||
if( cwi != null )
|
||||
{
|
||||
return cwi.getFuzzyMode( this.workBench.getInventoryByName( "cell" ).getStackInSlot( 0 ) );
|
||||
@@ -225,14 +225,14 @@ public class ContainerCellWorkbench extends ContainerUpgradeable
|
||||
|
||||
public void partition()
|
||||
{
|
||||
IInventory inv = this.upgradeable.getInventoryByName( "config" );
|
||||
final IInventory inv = this.upgradeable.getInventoryByName( "config" );
|
||||
|
||||
IMEInventory<IAEItemStack> cellInv = AEApi.instance().registries().cell().getCellInventory( this.upgradeable.getInventoryByName( "cell" ).getStackInSlot( 0 ), null, StorageChannel.ITEMS );
|
||||
final IMEInventory<IAEItemStack> cellInv = AEApi.instance().registries().cell().getCellInventory( this.upgradeable.getInventoryByName( "cell" ).getStackInSlot( 0 ), null, StorageChannel.ITEMS );
|
||||
|
||||
Iterator<IAEItemStack> i = new NullIterator<IAEItemStack>();
|
||||
if( cellInv != null )
|
||||
{
|
||||
IItemList<IAEItemStack> list = cellInv.getAvailableItems( AEApi.instance().storage().createItemList() );
|
||||
final IItemList<IAEItemStack> list = cellInv.getAvailableItems( AEApi.instance().storage().createItemList() );
|
||||
i = list.iterator();
|
||||
}
|
||||
|
||||
@@ -240,7 +240,7 @@ public class ContainerCellWorkbench extends ContainerUpgradeable
|
||||
{
|
||||
if( i.hasNext() )
|
||||
{
|
||||
ItemStack g = i.next().getItemStack();
|
||||
final ItemStack g = i.next().getItemStack();
|
||||
g.stackSize = 1;
|
||||
inv.setInventorySlotContents( x, g );
|
||||
}
|
||||
@@ -263,33 +263,33 @@ public class ContainerCellWorkbench extends ContainerUpgradeable
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlot( int i )
|
||||
public ItemStack getStackInSlot( final int i )
|
||||
{
|
||||
return ContainerCellWorkbench.this.getCellUpgradeInventory().getStackInSlot( i );
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack decrStackSize( int i, int j )
|
||||
public ItemStack decrStackSize( final int i, final int j )
|
||||
{
|
||||
IInventory inv = ContainerCellWorkbench.this.getCellUpgradeInventory();
|
||||
ItemStack is = inv.decrStackSize( i, j );
|
||||
final IInventory inv = ContainerCellWorkbench.this.getCellUpgradeInventory();
|
||||
final ItemStack is = inv.decrStackSize( i, j );
|
||||
inv.markDirty();
|
||||
return is;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlotOnClosing( int i )
|
||||
public ItemStack getStackInSlotOnClosing( final int i )
|
||||
{
|
||||
IInventory inv = ContainerCellWorkbench.this.getCellUpgradeInventory();
|
||||
ItemStack is = inv.getStackInSlotOnClosing( i );
|
||||
final IInventory inv = ContainerCellWorkbench.this.getCellUpgradeInventory();
|
||||
final ItemStack is = inv.getStackInSlotOnClosing( i );
|
||||
inv.markDirty();
|
||||
return is;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInventorySlotContents( int i, ItemStack itemstack )
|
||||
public void setInventorySlotContents( final int i, final ItemStack itemstack )
|
||||
{
|
||||
IInventory inv = ContainerCellWorkbench.this.getCellUpgradeInventory();
|
||||
final IInventory inv = ContainerCellWorkbench.this.getCellUpgradeInventory();
|
||||
inv.setInventorySlotContents( i, itemstack );
|
||||
inv.markDirty();
|
||||
}
|
||||
@@ -319,27 +319,27 @@ public class ContainerCellWorkbench extends ContainerUpgradeable
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUseableByPlayer( EntityPlayer entityplayer )
|
||||
public boolean isUseableByPlayer( final EntityPlayer entityplayer )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openInventory(
|
||||
EntityPlayer player )
|
||||
final EntityPlayer player )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void closeInventory(
|
||||
EntityPlayer player )
|
||||
final EntityPlayer player )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot( int i, ItemStack itemstack )
|
||||
public boolean isItemValidForSlot( final int i, final ItemStack itemstack )
|
||||
{
|
||||
return ContainerCellWorkbench.this.getCellUpgradeInventory().isItemValidForSlot( i, itemstack );
|
||||
}
|
||||
@@ -352,15 +352,15 @@ public class ContainerCellWorkbench extends ContainerUpgradeable
|
||||
|
||||
@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 )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ public class ContainerChest extends AEBaseContainer
|
||||
|
||||
final TileChest chest;
|
||||
|
||||
public ContainerChest( InventoryPlayer ip, TileChest chest )
|
||||
public ContainerChest( final InventoryPlayer ip, final TileChest chest )
|
||||
{
|
||||
super( ip, chest, null );
|
||||
this.chest = chest;
|
||||
|
||||
@@ -42,7 +42,7 @@ public class ContainerCondenser extends AEBaseContainer implements IProgressProv
|
||||
@GuiSync( 2 )
|
||||
public CondenserOutput output = CondenserOutput.TRASH;
|
||||
|
||||
public ContainerCondenser( InventoryPlayer ip, TileCondenser condenser )
|
||||
public ContainerCondenser( final InventoryPlayer ip, final TileCondenser condenser )
|
||||
{
|
||||
super( ip, condenser, null );
|
||||
this.condenser = condenser;
|
||||
@@ -59,8 +59,8 @@ public class ContainerCondenser extends AEBaseContainer implements IProgressProv
|
||||
{
|
||||
if( Platform.isServer() )
|
||||
{
|
||||
double maxStorage = this.condenser.getStorage();
|
||||
double requiredEnergy = this.condenser.getRequiredPower();
|
||||
final double maxStorage = this.condenser.getStorage();
|
||||
final double requiredEnergy = this.condenser.getRequiredPower();
|
||||
|
||||
this.requiredEnergy = requiredEnergy == 0 ? (int) maxStorage : (int) Math.min( requiredEnergy, maxStorage );
|
||||
this.storedPower = (int) this.condenser.storedPower;
|
||||
|
||||
@@ -41,7 +41,7 @@ public class ContainerCraftAmount extends AEBaseContainer
|
||||
final ITerminalHost priHost;
|
||||
public IAEItemStack whatToMake;
|
||||
|
||||
public ContainerCraftAmount( InventoryPlayer ip, ITerminalHost te )
|
||||
public ContainerCraftAmount( final InventoryPlayer ip, final ITerminalHost te )
|
||||
{
|
||||
super( ip, te );
|
||||
this.priHost = te;
|
||||
@@ -59,7 +59,7 @@ public class ContainerCraftAmount extends AEBaseContainer
|
||||
|
||||
public IGrid getGrid()
|
||||
{
|
||||
IActionHost h = ( (IActionHost) this.getTarget() );
|
||||
final IActionHost h = ( (IActionHost) this.getTarget() );
|
||||
return h.getActionableNode().getGrid();
|
||||
}
|
||||
|
||||
|
||||
@@ -88,13 +88,13 @@ public class ContainerCraftConfirm extends AEBaseContainer
|
||||
public String myName = "";
|
||||
protected long cpuIdx = Long.MIN_VALUE;
|
||||
|
||||
public ContainerCraftConfirm( InventoryPlayer ip, ITerminalHost te )
|
||||
public ContainerCraftConfirm( final InventoryPlayer ip, final ITerminalHost te )
|
||||
{
|
||||
super( ip, te );
|
||||
this.priHost = te;
|
||||
}
|
||||
|
||||
public void cycleCpu( boolean next )
|
||||
public void cycleCpu( final boolean next )
|
||||
{
|
||||
if( next )
|
||||
{
|
||||
@@ -136,15 +136,15 @@ public class ContainerCraftConfirm extends AEBaseContainer
|
||||
return;
|
||||
}
|
||||
|
||||
ICraftingGrid cc = this.getGrid().getCache( ICraftingGrid.class );
|
||||
ImmutableSet<ICraftingCPU> cpuSet = cc.getCpus();
|
||||
final ICraftingGrid cc = this.getGrid().getCache( ICraftingGrid.class );
|
||||
final ImmutableSet<ICraftingCPU> cpuSet = cc.getCpus();
|
||||
|
||||
int matches = 0;
|
||||
boolean changed = false;
|
||||
for( ICraftingCPU c : cpuSet )
|
||||
for( final ICraftingCPU c : cpuSet )
|
||||
{
|
||||
boolean found = false;
|
||||
for( CraftingCPURecord ccr : this.cpus )
|
||||
for( final CraftingCPURecord ccr : this.cpus )
|
||||
{
|
||||
if( ccr.cpu == c )
|
||||
{
|
||||
@@ -152,7 +152,7 @@ public class ContainerCraftConfirm extends AEBaseContainer
|
||||
}
|
||||
}
|
||||
|
||||
boolean matched = this.cpuMatches( c );
|
||||
final boolean matched = this.cpuMatches( c );
|
||||
|
||||
if( matched )
|
||||
{
|
||||
@@ -168,7 +168,7 @@ public class ContainerCraftConfirm extends AEBaseContainer
|
||||
if( changed || this.cpus.size() != matches )
|
||||
{
|
||||
this.cpus.clear();
|
||||
for( ICraftingCPU c : cpuSet )
|
||||
for( final ICraftingCPU c : cpuSet )
|
||||
{
|
||||
if( this.cpuMatches( c ) )
|
||||
{
|
||||
@@ -205,28 +205,28 @@ public class ContainerCraftConfirm extends AEBaseContainer
|
||||
|
||||
try
|
||||
{
|
||||
PacketMEInventoryUpdate a = new PacketMEInventoryUpdate( (byte) 0 );
|
||||
PacketMEInventoryUpdate b = new PacketMEInventoryUpdate( (byte) 1 );
|
||||
PacketMEInventoryUpdate c = this.result.isSimulation() ? new PacketMEInventoryUpdate( (byte) 2 ) : null;
|
||||
final PacketMEInventoryUpdate a = new PacketMEInventoryUpdate( (byte) 0 );
|
||||
final PacketMEInventoryUpdate b = new PacketMEInventoryUpdate( (byte) 1 );
|
||||
final PacketMEInventoryUpdate c = this.result.isSimulation() ? new PacketMEInventoryUpdate( (byte) 2 ) : null;
|
||||
|
||||
IItemList<IAEItemStack> plan = AEApi.instance().storage().createItemList();
|
||||
final IItemList<IAEItemStack> plan = AEApi.instance().storage().createItemList();
|
||||
this.result.populatePlan( plan );
|
||||
|
||||
this.bytesUsed = this.result.getByteTotal();
|
||||
|
||||
for( IAEItemStack out : plan )
|
||||
for( final IAEItemStack out : plan )
|
||||
{
|
||||
|
||||
IAEItemStack o = out.copy();
|
||||
o.reset();
|
||||
o.setStackSize( out.getStackSize() );
|
||||
|
||||
IAEItemStack p = out.copy();
|
||||
final IAEItemStack p = out.copy();
|
||||
p.reset();
|
||||
p.setStackSize( out.getCountRequestable() );
|
||||
|
||||
IStorageGrid sg = this.getGrid().getCache( IStorageGrid.class );
|
||||
IMEInventory<IAEItemStack> items = sg.getItemInventory();
|
||||
final IStorageGrid sg = this.getGrid().getCache( IStorageGrid.class );
|
||||
final IMEInventory<IAEItemStack> items = sg.getItemInventory();
|
||||
|
||||
IAEItemStack m = null;
|
||||
if( c != null && this.result.isSimulation() )
|
||||
@@ -259,7 +259,7 @@ public class ContainerCraftConfirm extends AEBaseContainer
|
||||
}
|
||||
}
|
||||
|
||||
for( Object g : this.crafters )
|
||||
for( final Object g : this.crafters )
|
||||
{
|
||||
if( g instanceof EntityPlayer )
|
||||
{
|
||||
@@ -272,12 +272,12 @@ public class ContainerCraftConfirm extends AEBaseContainer
|
||||
}
|
||||
}
|
||||
}
|
||||
catch( IOException e )
|
||||
catch( final IOException e )
|
||||
{
|
||||
// :P
|
||||
}
|
||||
}
|
||||
catch( Throwable e )
|
||||
catch( final Throwable e )
|
||||
{
|
||||
this.getPlayerInv().player.addChatMessage( new ChatComponentText( "Error: " + e.toString() ) );
|
||||
AELog.error( e );
|
||||
@@ -292,11 +292,11 @@ public class ContainerCraftConfirm extends AEBaseContainer
|
||||
|
||||
public IGrid getGrid()
|
||||
{
|
||||
IActionHost h = ( (IActionHost) this.getTarget() );
|
||||
final IActionHost h = ( (IActionHost) this.getTarget() );
|
||||
return h.getActionableNode().getGrid();
|
||||
}
|
||||
|
||||
private boolean cpuMatches( ICraftingCPU c )
|
||||
private boolean cpuMatches( final ICraftingCPU c )
|
||||
{
|
||||
return c.getAvailableStorage() >= this.bytesUsed && !c.isBusy();
|
||||
}
|
||||
@@ -324,7 +324,7 @@ public class ContainerCraftConfirm extends AEBaseContainer
|
||||
{
|
||||
GuiBridge originalGui = null;
|
||||
|
||||
IActionHost ah = this.getActionHost();
|
||||
final IActionHost ah = this.getActionHost();
|
||||
if( ah instanceof WirelessTerminalGuiObject )
|
||||
{
|
||||
originalGui = GuiBridge.GUI_WIRELESS_TERM;
|
||||
@@ -347,14 +347,14 @@ public class ContainerCraftConfirm extends AEBaseContainer
|
||||
|
||||
if( this.result != null && !this.simulation )
|
||||
{
|
||||
ICraftingGrid cc = this.getGrid().getCache( ICraftingGrid.class );
|
||||
ICraftingLink g = cc.submitJob( this.result, null, this.selectedCpu == -1 ? null : this.cpus.get( this.selectedCpu ).cpu, true, this.getActionSrc() );
|
||||
final ICraftingGrid cc = this.getGrid().getCache( ICraftingGrid.class );
|
||||
final ICraftingLink g = cc.submitJob( this.result, null, this.selectedCpu == -1 ? null : this.cpus.get( this.selectedCpu ).cpu, true, this.getActionSrc() );
|
||||
this.autoStart = false;
|
||||
if( g != null && originalGui != null && this.openContext != null )
|
||||
{
|
||||
NetworkHandler.instance.sendTo( new PacketSwitchGuis( originalGui ), (EntityPlayerMP) this.invPlayer.player );
|
||||
|
||||
TileEntity te = this.openContext.getTile();
|
||||
final TileEntity te = this.openContext.getTile();
|
||||
Platform.openGUI( this.invPlayer.player, te, this.openContext.side, originalGui );
|
||||
}
|
||||
}
|
||||
@@ -366,7 +366,7 @@ public class ContainerCraftConfirm extends AEBaseContainer
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeCraftingFromCrafters( ICrafting c )
|
||||
public void removeCraftingFromCrafters( final ICrafting c )
|
||||
{
|
||||
super.removeCraftingFromCrafters( c );
|
||||
if( this.job != null )
|
||||
@@ -377,7 +377,7 @@ public class ContainerCraftConfirm extends AEBaseContainer
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onContainerClosed( EntityPlayer par1EntityPlayer )
|
||||
public void onContainerClosed( final EntityPlayer par1EntityPlayer )
|
||||
{
|
||||
super.onContainerClosed( par1EntityPlayer );
|
||||
if( this.job != null )
|
||||
|
||||
@@ -62,15 +62,15 @@ public class ContainerCraftingCPU extends AEBaseContainer implements IMEMonitorH
|
||||
@GuiSync( 0 )
|
||||
public long eta = -1;
|
||||
|
||||
public ContainerCraftingCPU( InventoryPlayer ip, Object te )
|
||||
public ContainerCraftingCPU( final InventoryPlayer ip, final Object te )
|
||||
{
|
||||
super( ip, te );
|
||||
IGridHost host = (IGridHost) ( te instanceof IGridHost ? te : null );
|
||||
final IGridHost host = (IGridHost) ( te instanceof IGridHost ? te : null );
|
||||
|
||||
if( host != null )
|
||||
{
|
||||
this.findNode( host, AEPartLocation.INTERNAL );
|
||||
for( AEPartLocation d : AEPartLocation.SIDE_LOCATIONS )
|
||||
for( final AEPartLocation d : AEPartLocation.SIDE_LOCATIONS )
|
||||
{
|
||||
this.findNode( host, d );
|
||||
}
|
||||
@@ -87,11 +87,11 @@ public class ContainerCraftingCPU extends AEBaseContainer implements IMEMonitorH
|
||||
}
|
||||
}
|
||||
|
||||
private void findNode( IGridHost host, AEPartLocation d )
|
||||
private void findNode( final IGridHost host, final AEPartLocation d )
|
||||
{
|
||||
if( this.network == null )
|
||||
{
|
||||
IGridNode node = host.getGridNode( d );
|
||||
final IGridNode node = host.getGridNode( d );
|
||||
if( node != null )
|
||||
{
|
||||
this.network = node.getGrid();
|
||||
@@ -99,7 +99,7 @@ public class ContainerCraftingCPU extends AEBaseContainer implements IMEMonitorH
|
||||
}
|
||||
}
|
||||
|
||||
protected void setCPU( ICraftingCPU c )
|
||||
protected void setCPU( final ICraftingCPU c )
|
||||
{
|
||||
if( c == this.monitor )
|
||||
{
|
||||
@@ -111,7 +111,7 @@ public class ContainerCraftingCPU extends AEBaseContainer implements IMEMonitorH
|
||||
this.monitor.removeListener( this );
|
||||
}
|
||||
|
||||
for( Object g : this.crafters )
|
||||
for( final Object g : this.crafters )
|
||||
{
|
||||
if( g instanceof EntityPlayer )
|
||||
{
|
||||
@@ -119,7 +119,7 @@ public class ContainerCraftingCPU extends AEBaseContainer implements IMEMonitorH
|
||||
{
|
||||
NetworkHandler.instance.sendTo( new PacketValueConfig( "CraftingStatus", "Clear" ), (EntityPlayerMP) g );
|
||||
}
|
||||
catch( IOException e )
|
||||
catch( final IOException e )
|
||||
{
|
||||
AELog.error( e );
|
||||
}
|
||||
@@ -153,7 +153,7 @@ public class ContainerCraftingCPU extends AEBaseContainer implements IMEMonitorH
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeCraftingFromCrafters( ICrafting c )
|
||||
public void removeCraftingFromCrafters( final ICrafting c )
|
||||
{
|
||||
super.removeCraftingFromCrafters( c );
|
||||
|
||||
@@ -164,7 +164,7 @@ public class ContainerCraftingCPU extends AEBaseContainer implements IMEMonitorH
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onContainerClosed( EntityPlayer player )
|
||||
public void onContainerClosed( final EntityPlayer player )
|
||||
{
|
||||
super.onContainerClosed( player );
|
||||
if( this.monitor != null )
|
||||
@@ -189,11 +189,11 @@ public class ContainerCraftingCPU extends AEBaseContainer implements IMEMonitorH
|
||||
this.eta = eta;
|
||||
}
|
||||
|
||||
PacketMEInventoryUpdate a = new PacketMEInventoryUpdate( (byte) 0 );
|
||||
PacketMEInventoryUpdate b = new PacketMEInventoryUpdate( (byte) 1 );
|
||||
PacketMEInventoryUpdate c = new PacketMEInventoryUpdate( (byte) 2 );
|
||||
final PacketMEInventoryUpdate a = new PacketMEInventoryUpdate( (byte) 0 );
|
||||
final PacketMEInventoryUpdate b = new PacketMEInventoryUpdate( (byte) 1 );
|
||||
final PacketMEInventoryUpdate c = new PacketMEInventoryUpdate( (byte) 2 );
|
||||
|
||||
for( IAEItemStack out : this.list )
|
||||
for( final IAEItemStack out : this.list )
|
||||
{
|
||||
a.appendItem( this.monitor.getItemStack( out, CraftingItemList.STORAGE ) );
|
||||
b.appendItem( this.monitor.getItemStack( out, CraftingItemList.ACTIVE ) );
|
||||
@@ -202,7 +202,7 @@ public class ContainerCraftingCPU extends AEBaseContainer implements IMEMonitorH
|
||||
|
||||
this.list.resetStatus();
|
||||
|
||||
for( Object g : this.crafters )
|
||||
for( final Object g : this.crafters )
|
||||
{
|
||||
if( g instanceof EntityPlayer )
|
||||
{
|
||||
@@ -223,7 +223,7 @@ public class ContainerCraftingCPU extends AEBaseContainer implements IMEMonitorH
|
||||
}
|
||||
}
|
||||
}
|
||||
catch( IOException e )
|
||||
catch( final IOException e )
|
||||
{
|
||||
// :P
|
||||
}
|
||||
@@ -232,13 +232,13 @@ public class ContainerCraftingCPU extends AEBaseContainer implements IMEMonitorH
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid( Object verificationToken )
|
||||
public boolean isValid( final Object verificationToken )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postChange( IBaseMonitor<IAEItemStack> monitor, Iterable<IAEItemStack> change, BaseActionSource actionSource )
|
||||
public void postChange( final IBaseMonitor<IAEItemStack> monitor, final Iterable<IAEItemStack> change, final BaseActionSource actionSource )
|
||||
{
|
||||
for( IAEItemStack is : change )
|
||||
{
|
||||
|
||||
@@ -42,7 +42,7 @@ public class ContainerCraftingStatus extends ContainerCraftingCPU
|
||||
@GuiSync( 7 )
|
||||
public String myName = "";
|
||||
|
||||
public ContainerCraftingStatus( InventoryPlayer ip, ITerminalHost te )
|
||||
public ContainerCraftingStatus( final InventoryPlayer ip, final ITerminalHost te )
|
||||
{
|
||||
super( ip, te );
|
||||
}
|
||||
@@ -50,15 +50,15 @@ public class ContainerCraftingStatus extends ContainerCraftingCPU
|
||||
@Override
|
||||
public void detectAndSendChanges()
|
||||
{
|
||||
ICraftingGrid cc = this.network.getCache( ICraftingGrid.class );
|
||||
ImmutableSet<ICraftingCPU> cpuSet = cc.getCpus();
|
||||
final ICraftingGrid cc = this.network.getCache( ICraftingGrid.class );
|
||||
final ImmutableSet<ICraftingCPU> cpuSet = cc.getCpus();
|
||||
|
||||
int matches = 0;
|
||||
boolean changed = false;
|
||||
for( ICraftingCPU c : cpuSet )
|
||||
for( final ICraftingCPU c : cpuSet )
|
||||
{
|
||||
boolean found = false;
|
||||
for( CraftingCPURecord ccr : this.cpus )
|
||||
for( final CraftingCPURecord ccr : this.cpus )
|
||||
{
|
||||
if( ccr.cpu == c )
|
||||
{
|
||||
@@ -66,7 +66,7 @@ public class ContainerCraftingStatus extends ContainerCraftingCPU
|
||||
}
|
||||
}
|
||||
|
||||
boolean matched = this.cpuMatches( c );
|
||||
final boolean matched = this.cpuMatches( c );
|
||||
|
||||
if( matched )
|
||||
{
|
||||
@@ -82,7 +82,7 @@ public class ContainerCraftingStatus extends ContainerCraftingCPU
|
||||
if( changed || this.cpus.size() != matches )
|
||||
{
|
||||
this.cpus.clear();
|
||||
for( ICraftingCPU c : cpuSet )
|
||||
for( final ICraftingCPU c : cpuSet )
|
||||
{
|
||||
if( this.cpuMatches( c ) )
|
||||
{
|
||||
@@ -98,7 +98,7 @@ public class ContainerCraftingStatus extends ContainerCraftingCPU
|
||||
super.detectAndSendChanges();
|
||||
}
|
||||
|
||||
private boolean cpuMatches( ICraftingCPU c )
|
||||
private boolean cpuMatches( final ICraftingCPU c )
|
||||
{
|
||||
return c.isBusy();
|
||||
}
|
||||
@@ -135,7 +135,7 @@ public class ContainerCraftingStatus extends ContainerCraftingCPU
|
||||
}
|
||||
}
|
||||
|
||||
public void cycleCpu( boolean next )
|
||||
public void cycleCpu( final boolean next )
|
||||
{
|
||||
if( next )
|
||||
{
|
||||
|
||||
@@ -43,12 +43,12 @@ public class ContainerCraftingTerm extends ContainerMEMonitorable implements IAE
|
||||
final SlotCraftingMatrix[] craftingSlots = new SlotCraftingMatrix[9];
|
||||
final SlotCraftingTerm outputSlot;
|
||||
|
||||
public ContainerCraftingTerm( InventoryPlayer ip, ITerminalHost monitorable )
|
||||
public ContainerCraftingTerm( final InventoryPlayer ip, final ITerminalHost monitorable )
|
||||
{
|
||||
super( ip, monitorable, false );
|
||||
this.ct = (PartCraftingTerminal) monitorable;
|
||||
|
||||
IInventory crafting = this.ct.getInventoryByName( "crafting" );
|
||||
final IInventory crafting = this.ct.getInventoryByName( "crafting" );
|
||||
|
||||
for( int y = 0; y < 3; y++ )
|
||||
{
|
||||
@@ -69,10 +69,10 @@ public class ContainerCraftingTerm extends ContainerMEMonitorable implements IAE
|
||||
* Callback for when the crafting matrix is changed.
|
||||
*/
|
||||
@Override
|
||||
public void onCraftMatrixChanged( IInventory par1IInventory )
|
||||
public void onCraftMatrixChanged( final IInventory par1IInventory )
|
||||
{
|
||||
ContainerNull cn = new ContainerNull();
|
||||
InventoryCrafting ic = new InventoryCrafting( cn, 3, 3 );
|
||||
final ContainerNull cn = new ContainerNull();
|
||||
final InventoryCrafting ic = new InventoryCrafting( cn, 3, 3 );
|
||||
|
||||
for( int x = 0; x < 9; x++ )
|
||||
{
|
||||
@@ -89,13 +89,13 @@ public class ContainerCraftingTerm extends ContainerMEMonitorable implements IAE
|
||||
}
|
||||
|
||||
@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 IInventory getInventoryByName( String name )
|
||||
public IInventory getInventoryByName( final String name )
|
||||
{
|
||||
if( name.equals( "player" ) )
|
||||
{
|
||||
|
||||
@@ -30,7 +30,7 @@ public class ContainerDrive extends AEBaseContainer
|
||||
|
||||
final TileDrive drive;
|
||||
|
||||
public ContainerDrive( InventoryPlayer ip, TileDrive drive )
|
||||
public ContainerDrive( final InventoryPlayer ip, final TileDrive drive )
|
||||
{
|
||||
super( ip, drive, null );
|
||||
this.drive = drive;
|
||||
|
||||
@@ -42,7 +42,7 @@ public class ContainerFormationPlane extends ContainerUpgradeable
|
||||
@GuiSync( 6 )
|
||||
public YesNo placeMode;
|
||||
|
||||
public ContainerFormationPlane( InventoryPlayer ip, PartFormationPlane te )
|
||||
public ContainerFormationPlane( final InventoryPlayer ip, final PartFormationPlane te )
|
||||
{
|
||||
super( ip, te );
|
||||
this.storageBus = te;
|
||||
@@ -57,10 +57,10 @@ public class ContainerFormationPlane extends ContainerUpgradeable
|
||||
@Override
|
||||
protected void setupConfig()
|
||||
{
|
||||
int xo = 8;
|
||||
int yo = 23 + 6;
|
||||
final int xo = 8;
|
||||
final int yo = 23 + 6;
|
||||
|
||||
IInventory config = this.upgradeable.getInventoryByName( "config" );
|
||||
final IInventory config = this.upgradeable.getInventoryByName( "config" );
|
||||
for( int y = 0; y < 7; y++ )
|
||||
{
|
||||
for( int x = 0; x < 9; x++ )
|
||||
@@ -76,7 +76,7 @@ public class ContainerFormationPlane extends ContainerUpgradeable
|
||||
}
|
||||
}
|
||||
|
||||
IInventory upgrades = this.upgradeable.getInventoryByName( "upgrades" );
|
||||
final IInventory upgrades = this.upgradeable.getInventoryByName( "upgrades" );
|
||||
this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8, this.invPlayer ) ).setNotDraggable() );
|
||||
this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 1, 187, 8 + 18, this.invPlayer ) ).setNotDraggable() );
|
||||
this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 2, 187, 8 + 18 * 2, this.invPlayer ) ).setNotDraggable() );
|
||||
@@ -111,9 +111,9 @@ public class ContainerFormationPlane extends ContainerUpgradeable
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSlotEnabled( int idx )
|
||||
public boolean isSlotEnabled( final int idx )
|
||||
{
|
||||
int upgrades = this.upgradeable.getInstalledUpgrades( Upgrades.CAPACITY );
|
||||
final int upgrades = this.upgradeable.getInstalledUpgrades( Upgrades.CAPACITY );
|
||||
|
||||
return upgrades > idx;
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ public class ContainerGrinder extends AEBaseContainer
|
||||
|
||||
final TileGrinder grinder;
|
||||
|
||||
public ContainerGrinder( InventoryPlayer ip, TileGrinder grinder )
|
||||
public ContainerGrinder( final InventoryPlayer ip, final TileGrinder grinder )
|
||||
{
|
||||
super( ip, grinder, null );
|
||||
this.grinder = grinder;
|
||||
|
||||
@@ -43,7 +43,7 @@ public class ContainerIOPort extends ContainerUpgradeable
|
||||
@GuiSync( 3 )
|
||||
public OperationMode opMode = OperationMode.EMPTY;
|
||||
|
||||
public ContainerIOPort( InventoryPlayer ip, TileIOPort te )
|
||||
public ContainerIOPort( final InventoryPlayer ip, final TileIOPort te )
|
||||
{
|
||||
super( ip, te );
|
||||
this.ioPort = te;
|
||||
@@ -61,7 +61,7 @@ public class ContainerIOPort extends ContainerUpgradeable
|
||||
int offX = 19;
|
||||
int offY = 17;
|
||||
|
||||
IInventory cells = this.upgradeable.getInventoryByName( "cells" );
|
||||
final IInventory cells = this.upgradeable.getInventoryByName( "cells" );
|
||||
|
||||
for( int y = 0; y < 3; y++ )
|
||||
{
|
||||
@@ -81,7 +81,7 @@ public class ContainerIOPort extends ContainerUpgradeable
|
||||
}
|
||||
}
|
||||
|
||||
IInventory upgrades = this.upgradeable.getInventoryByName( "upgrades" );
|
||||
final IInventory upgrades = this.upgradeable.getInventoryByName( "upgrades" );
|
||||
this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8, this.invPlayer ) ).setNotDraggable() );
|
||||
this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 1, 187, 8 + 18, this.invPlayer ) ).setNotDraggable() );
|
||||
this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 2, 187, 8 + 18 * 2, this.invPlayer ) ).setNotDraggable() );
|
||||
|
||||
@@ -54,7 +54,7 @@ public class ContainerInscriber extends ContainerUpgradeable implements IProgres
|
||||
@GuiSync( 3 )
|
||||
public int processingTime = -1;
|
||||
|
||||
public ContainerInscriber( InventoryPlayer ip, TileInscriber te )
|
||||
public ContainerInscriber( final InventoryPlayer ip, final TileInscriber te )
|
||||
{
|
||||
super( ip, te );
|
||||
this.ti = te;
|
||||
@@ -105,14 +105,14 @@ public class ContainerInscriber extends ContainerUpgradeable implements IProgres
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValidForSlot( Slot s, ItemStack is )
|
||||
public boolean isValidForSlot( final Slot s, final ItemStack is )
|
||||
{
|
||||
ItemStack top = this.ti.getStackInSlot( 0 );
|
||||
ItemStack bot = this.ti.getStackInSlot( 1 );
|
||||
final ItemStack top = this.ti.getStackInSlot( 0 );
|
||||
final ItemStack bot = this.ti.getStackInSlot( 1 );
|
||||
|
||||
if( s == this.middle )
|
||||
{
|
||||
for( ItemStack optional : AEApi.instance().registries().inscriber().getOptionals() )
|
||||
for( final ItemStack optional : AEApi.instance().registries().inscriber().getOptionals() )
|
||||
{
|
||||
if( Platform.isSameItemPrecise( optional, is ) )
|
||||
{
|
||||
@@ -123,18 +123,18 @@ public class ContainerInscriber extends ContainerUpgradeable implements IProgres
|
||||
boolean matches = false;
|
||||
boolean found = false;
|
||||
|
||||
for( IInscriberRecipe recipe : AEApi.instance().registries().inscriber().getRecipes() )
|
||||
for( final IInscriberRecipe recipe : AEApi.instance().registries().inscriber().getRecipes() )
|
||||
{
|
||||
boolean matchA = ( top == null && !recipe.getTopOptional().isPresent() ) || ( Platform.isSameItemPrecise( top, recipe.getTopOptional().orNull() ) ) && // and...
|
||||
final boolean matchA = ( top == null && !recipe.getTopOptional().isPresent() ) || ( Platform.isSameItemPrecise( top, recipe.getTopOptional().orNull() ) ) && // and...
|
||||
( bot == null && !recipe.getBottomOptional().isPresent() ) | ( Platform.isSameItemPrecise( bot, recipe.getBottomOptional().orNull() ) );
|
||||
|
||||
boolean matchB = ( bot == null && !recipe.getTopOptional().isPresent() ) || ( Platform.isSameItemPrecise( bot, recipe.getTopOptional().orNull() ) ) && // and...
|
||||
final boolean matchB = ( bot == null && !recipe.getTopOptional().isPresent() ) || ( Platform.isSameItemPrecise( bot, recipe.getTopOptional().orNull() ) ) && // and...
|
||||
( top == null && !recipe.getBottomOptional().isPresent() ) | ( Platform.isSameItemPrecise( top, recipe.getBottomOptional().orNull() ) );
|
||||
|
||||
if( matchA || matchB )
|
||||
{
|
||||
matches = true;
|
||||
for( ItemStack option : recipe.getInputs() )
|
||||
for( final ItemStack option : recipe.getInputs() )
|
||||
{
|
||||
if( Platform.isSameItemPrecise( is, option ) )
|
||||
{
|
||||
@@ -171,7 +171,7 @@ public class ContainerInscriber extends ContainerUpgradeable implements IProgres
|
||||
|
||||
// everything else
|
||||
boolean isValid = false;
|
||||
for( IInscriberRecipe recipe : AEApi.instance().registries().inscriber().getRecipes() )
|
||||
for( final IInscriberRecipe recipe : AEApi.instance().registries().inscriber().getRecipes() )
|
||||
{
|
||||
if( Platform.isSameItemPrecise( recipe.getTopOptional().orNull(), otherSlot ) )
|
||||
{
|
||||
|
||||
@@ -43,7 +43,7 @@ public class ContainerInterface extends ContainerUpgradeable
|
||||
@GuiSync( 4 )
|
||||
public YesNo iTermMode = YesNo.YES;
|
||||
|
||||
public ContainerInterface( InventoryPlayer ip, IInterfaceHost te )
|
||||
public ContainerInterface( final InventoryPlayer ip, final IInterfaceHost te )
|
||||
{
|
||||
super( ip, te.getInterfaceDuality().getHost() );
|
||||
|
||||
@@ -91,7 +91,7 @@ public class ContainerInterface extends ContainerUpgradeable
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void loadSettingsFromHost( IConfigManager cm )
|
||||
protected void loadSettingsFromHost( final IConfigManager cm )
|
||||
{
|
||||
this.bMode = (YesNo) cm.getSetting( Settings.BLOCK );
|
||||
this.iTermMode = (YesNo) cm.getSetting( Settings.INTERFACE_TERMINAL );
|
||||
|
||||
@@ -66,7 +66,7 @@ public final class ContainerInterfaceTerminal extends AEBaseContainer
|
||||
IGrid grid;
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
|
||||
public ContainerInterfaceTerminal( InventoryPlayer ip, PartInterfaceTerminal anchor )
|
||||
public ContainerInterfaceTerminal( final InventoryPlayer ip, final PartInterfaceTerminal anchor )
|
||||
{
|
||||
super( ip, anchor );
|
||||
|
||||
@@ -96,23 +96,23 @@ public final class ContainerInterfaceTerminal extends AEBaseContainer
|
||||
int total = 0;
|
||||
boolean missing = false;
|
||||
|
||||
IActionHost host = this.getActionHost();
|
||||
final IActionHost host = this.getActionHost();
|
||||
if( host != null )
|
||||
{
|
||||
IGridNode agn = host.getActionableNode();
|
||||
final IGridNode agn = host.getActionableNode();
|
||||
if( agn != null && agn.isActive() )
|
||||
{
|
||||
for( IGridNode gn : this.grid.getMachines( TileInterface.class ) )
|
||||
for( final IGridNode gn : this.grid.getMachines( TileInterface.class ) )
|
||||
{
|
||||
if( gn.isActive() )
|
||||
{
|
||||
IInterfaceHost ih = (IInterfaceHost) gn.getMachine();
|
||||
final IInterfaceHost ih = (IInterfaceHost) gn.getMachine();
|
||||
if( ih.getInterfaceDuality().getConfigManager().getSetting( Settings.INTERFACE_TERMINAL ) == YesNo.NO )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
InvTracker t = this.diList.get( ih );
|
||||
final InvTracker t = this.diList.get( ih );
|
||||
|
||||
if( t == null )
|
||||
{
|
||||
@@ -120,7 +120,7 @@ public final class ContainerInterfaceTerminal extends AEBaseContainer
|
||||
}
|
||||
else
|
||||
{
|
||||
DualityInterface dual = ih.getInterfaceDuality();
|
||||
final DualityInterface dual = ih.getInterfaceDuality();
|
||||
if( !t.unlocalizedName.equals( dual.getTermName() ) )
|
||||
{
|
||||
missing = true;
|
||||
@@ -131,17 +131,17 @@ public final class ContainerInterfaceTerminal extends AEBaseContainer
|
||||
}
|
||||
}
|
||||
|
||||
for( IGridNode gn : this.grid.getMachines( PartInterface.class ) )
|
||||
for( final IGridNode gn : this.grid.getMachines( PartInterface.class ) )
|
||||
{
|
||||
if( gn.isActive() )
|
||||
{
|
||||
IInterfaceHost ih = (IInterfaceHost) gn.getMachine();
|
||||
final IInterfaceHost ih = (IInterfaceHost) gn.getMachine();
|
||||
if( ih.getInterfaceDuality().getConfigManager().getSetting( Settings.INTERFACE_TERMINAL ) == YesNo.NO )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
InvTracker t = this.diList.get( ih );
|
||||
final InvTracker t = this.diList.get( ih );
|
||||
|
||||
if( t == null )
|
||||
{
|
||||
@@ -149,7 +149,7 @@ public final class ContainerInterfaceTerminal extends AEBaseContainer
|
||||
}
|
||||
else
|
||||
{
|
||||
DualityInterface dual = ih.getInterfaceDuality();
|
||||
final DualityInterface dual = ih.getInterfaceDuality();
|
||||
if( !t.unlocalizedName.equals( dual.getTermName() ) )
|
||||
{
|
||||
missing = true;
|
||||
@@ -168,9 +168,9 @@ public final class ContainerInterfaceTerminal extends AEBaseContainer
|
||||
}
|
||||
else
|
||||
{
|
||||
for( Entry<IInterfaceHost, InvTracker> en : this.diList.entrySet() )
|
||||
for( final Entry<IInterfaceHost, InvTracker> en : this.diList.entrySet() )
|
||||
{
|
||||
InvTracker inv = en.getValue();
|
||||
final InvTracker inv = en.getValue();
|
||||
for( int x = 0; x < inv.server.getSizeInventory(); x++ )
|
||||
{
|
||||
if( this.isDifferent( inv.server.getStackInSlot( x ), inv.client.getStackInSlot( x ) ) )
|
||||
@@ -187,7 +187,7 @@ public final class ContainerInterfaceTerminal extends AEBaseContainer
|
||||
{
|
||||
NetworkHandler.instance.sendTo( new PacketCompressedNBT( this.data ), (EntityPlayerMP) this.getPlayerInv().player );
|
||||
}
|
||||
catch( IOException e )
|
||||
catch( final IOException e )
|
||||
{
|
||||
// :P
|
||||
}
|
||||
@@ -197,20 +197,20 @@ public final class ContainerInterfaceTerminal extends AEBaseContainer
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doAction( EntityPlayerMP player, InventoryAction action, int slot, long id )
|
||||
public void doAction( final EntityPlayerMP player, final InventoryAction action, final int slot, final long id )
|
||||
{
|
||||
InvTracker inv = this.byId.get( id );
|
||||
final InvTracker inv = this.byId.get( id );
|
||||
if( inv != null )
|
||||
{
|
||||
ItemStack is = inv.server.getStackInSlot( slot );
|
||||
boolean hasItemInHand = player.inventory.getItemStack() != null;
|
||||
final ItemStack is = inv.server.getStackInSlot( slot );
|
||||
final boolean hasItemInHand = player.inventory.getItemStack() != null;
|
||||
|
||||
InventoryAdaptor playerHand = new AdaptorPlayerHand( player );
|
||||
final InventoryAdaptor playerHand = new AdaptorPlayerHand( player );
|
||||
|
||||
WrapperInvSlot slotInv = new PatternInvSlot( inv.server );
|
||||
final WrapperInvSlot slotInv = new PatternInvSlot( inv.server );
|
||||
|
||||
IInventory theSlot = slotInv.getWrapper( slot );
|
||||
InventoryAdaptor interfaceSlot = new AdaptorIInventory( theSlot );
|
||||
final IInventory theSlot = slotInv.getWrapper( slot );
|
||||
final InventoryAdaptor interfaceSlot = new AdaptorIInventory( theSlot );
|
||||
|
||||
switch( action )
|
||||
{
|
||||
@@ -226,7 +226,7 @@ public final class ContainerInterfaceTerminal extends AEBaseContainer
|
||||
else
|
||||
{
|
||||
inSlot = inSlot.copy();
|
||||
ItemStack inHand = player.inventory.getItemStack().copy();
|
||||
final ItemStack inHand = player.inventory.getItemStack().copy();
|
||||
|
||||
theSlot.setInventorySlotContents( 0, null );
|
||||
player.inventory.setItemStack( null );
|
||||
@@ -246,7 +246,7 @@ public final class ContainerInterfaceTerminal extends AEBaseContainer
|
||||
}
|
||||
else
|
||||
{
|
||||
IInventory mySlot = slotInv.getWrapper( slot );
|
||||
final IInventory mySlot = slotInv.getWrapper( slot );
|
||||
mySlot.setInventorySlotContents( 0, playerHand.addItems( mySlot.getStackInSlot( 0 ) ) );
|
||||
}
|
||||
|
||||
@@ -281,14 +281,14 @@ public final class ContainerInterfaceTerminal extends AEBaseContainer
|
||||
break;
|
||||
case SHIFT_CLICK:
|
||||
|
||||
IInventory mySlot = slotInv.getWrapper( slot );
|
||||
InventoryAdaptor playerInv = InventoryAdaptor.getAdaptor( player, EnumFacing.UP );
|
||||
final IInventory mySlot = slotInv.getWrapper( slot );
|
||||
final InventoryAdaptor playerInv = InventoryAdaptor.getAdaptor( player, EnumFacing.UP );
|
||||
mySlot.setInventorySlotContents( 0, playerInv.addItems( mySlot.getStackInSlot( 0 ) ) );
|
||||
|
||||
break;
|
||||
case MOVE_REGION:
|
||||
|
||||
InventoryAdaptor playerInvAd = InventoryAdaptor.getAdaptor( player, EnumFacing.UP );
|
||||
final InventoryAdaptor playerInvAd = InventoryAdaptor.getAdaptor( player, EnumFacing.UP );
|
||||
for( int x = 0; x < inv.server.getSizeInventory(); x++ )
|
||||
{
|
||||
inv.server.setInventorySlotContents( x, playerInvAd.addItems( inv.server.getStackInSlot( x ) ) );
|
||||
@@ -311,31 +311,31 @@ public final class ContainerInterfaceTerminal extends AEBaseContainer
|
||||
}
|
||||
}
|
||||
|
||||
private void regenList( NBTTagCompound data )
|
||||
private void regenList( final NBTTagCompound data )
|
||||
{
|
||||
this.byId.clear();
|
||||
this.diList.clear();
|
||||
|
||||
IActionHost host = this.getActionHost();
|
||||
final IActionHost host = this.getActionHost();
|
||||
if( host != null )
|
||||
{
|
||||
IGridNode agn = host.getActionableNode();
|
||||
final IGridNode agn = host.getActionableNode();
|
||||
if( agn != null && agn.isActive() )
|
||||
{
|
||||
for( IGridNode gn : this.grid.getMachines( TileInterface.class ) )
|
||||
for( final IGridNode gn : this.grid.getMachines( TileInterface.class ) )
|
||||
{
|
||||
IInterfaceHost ih = (IInterfaceHost) gn.getMachine();
|
||||
DualityInterface dual = ih.getInterfaceDuality();
|
||||
final IInterfaceHost ih = (IInterfaceHost) gn.getMachine();
|
||||
final DualityInterface dual = ih.getInterfaceDuality();
|
||||
if( gn.isActive() && dual.getConfigManager().getSetting( Settings.INTERFACE_TERMINAL ) == YesNo.YES )
|
||||
{
|
||||
this.diList.put( ih, new InvTracker( dual, dual.getPatterns(), dual.getTermName() ) );
|
||||
}
|
||||
}
|
||||
|
||||
for( IGridNode gn : this.grid.getMachines( PartInterface.class ) )
|
||||
for( final IGridNode gn : this.grid.getMachines( PartInterface.class ) )
|
||||
{
|
||||
IInterfaceHost ih = (IInterfaceHost) gn.getMachine();
|
||||
DualityInterface dual = ih.getInterfaceDuality();
|
||||
final IInterfaceHost ih = (IInterfaceHost) gn.getMachine();
|
||||
final DualityInterface dual = ih.getInterfaceDuality();
|
||||
if( gn.isActive() && dual.getConfigManager().getSetting( Settings.INTERFACE_TERMINAL ) == YesNo.YES )
|
||||
{
|
||||
this.diList.put( ih, new InvTracker( dual, dual.getPatterns(), dual.getTermName() ) );
|
||||
@@ -346,15 +346,15 @@ public final class ContainerInterfaceTerminal extends AEBaseContainer
|
||||
|
||||
data.setBoolean( "clear", true );
|
||||
|
||||
for( Entry<IInterfaceHost, InvTracker> en : this.diList.entrySet() )
|
||||
for( final Entry<IInterfaceHost, InvTracker> en : this.diList.entrySet() )
|
||||
{
|
||||
InvTracker inv = en.getValue();
|
||||
final InvTracker inv = en.getValue();
|
||||
this.byId.put( inv.which, inv );
|
||||
this.addItems( data, inv, 0, inv.server.getSizeInventory() );
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isDifferent( ItemStack a, ItemStack b )
|
||||
private boolean isDifferent( final ItemStack a, final ItemStack b )
|
||||
{
|
||||
if( a == null && b == null )
|
||||
{
|
||||
@@ -369,10 +369,10 @@ public final class ContainerInterfaceTerminal extends AEBaseContainer
|
||||
return !ItemStack.areItemStacksEqual( a, b );
|
||||
}
|
||||
|
||||
private void addItems( NBTTagCompound data, InvTracker inv, int offset, int length )
|
||||
private void addItems( final NBTTagCompound data, final InvTracker inv, final int offset, final int length )
|
||||
{
|
||||
String name = '=' + Long.toString( inv.which, Character.MAX_RADIX );
|
||||
NBTTagCompound tag = data.getCompoundTag( name );
|
||||
final String name = '=' + Long.toString( inv.which, Character.MAX_RADIX );
|
||||
final NBTTagCompound tag = data.getCompoundTag( name );
|
||||
|
||||
if( tag.hasNoTags() )
|
||||
{
|
||||
@@ -382,9 +382,9 @@ public final class ContainerInterfaceTerminal extends AEBaseContainer
|
||||
|
||||
for( int x = 0; x < length; x++ )
|
||||
{
|
||||
NBTTagCompound itemNBT = new NBTTagCompound();
|
||||
final NBTTagCompound itemNBT = new NBTTagCompound();
|
||||
|
||||
ItemStack is = inv.server.getStackInSlot( x + offset );
|
||||
final ItemStack is = inv.server.getStackInSlot( x + offset );
|
||||
|
||||
// "update" client side.
|
||||
inv.client.setInventorySlotContents( x + offset, is == null ? null : is.copy() );
|
||||
@@ -409,7 +409,7 @@ public final class ContainerInterfaceTerminal extends AEBaseContainer
|
||||
final IInventory client;
|
||||
final IInventory server;
|
||||
|
||||
public InvTracker( DualityInterface dual, IInventory patterns, String unlocalizedName )
|
||||
public InvTracker( final DualityInterface dual, final IInventory patterns, final String unlocalizedName )
|
||||
{
|
||||
this.server = patterns;
|
||||
this.client = new AppEngInternalInventory( null, this.server.getSizeInventory() );
|
||||
@@ -421,13 +421,13 @@ public final class ContainerInterfaceTerminal extends AEBaseContainer
|
||||
static class PatternInvSlot extends WrapperInvSlot
|
||||
{
|
||||
|
||||
public PatternInvSlot( IInventory inv )
|
||||
public PatternInvSlot( final IInventory inv )
|
||||
{
|
||||
super( inv );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValid( ItemStack itemstack )
|
||||
public boolean isItemValid( final ItemStack itemstack )
|
||||
{
|
||||
return itemstack != null && itemstack.getItem() instanceof ItemEncodedPattern;
|
||||
}
|
||||
|
||||
@@ -52,20 +52,20 @@ public class ContainerLevelEmitter extends ContainerUpgradeable
|
||||
@GuiSync( 4 )
|
||||
public YesNo cmType;
|
||||
|
||||
public ContainerLevelEmitter( InventoryPlayer ip, PartLevelEmitter te )
|
||||
public ContainerLevelEmitter( final InventoryPlayer ip, final PartLevelEmitter te )
|
||||
{
|
||||
super( ip, te );
|
||||
this.lvlEmitter = te;
|
||||
}
|
||||
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void setTextField( GuiTextField level )
|
||||
public void setTextField( final GuiTextField level )
|
||||
{
|
||||
this.textField = level;
|
||||
this.textField.setText( String.valueOf( this.EmitterValue ) );
|
||||
}
|
||||
|
||||
public void setLevel( long l, EntityPlayer player )
|
||||
public void setLevel( final long l, final EntityPlayer player )
|
||||
{
|
||||
this.lvlEmitter.setReportingValue( l );
|
||||
this.EmitterValue = l;
|
||||
@@ -75,7 +75,7 @@ public class ContainerLevelEmitter extends ContainerUpgradeable
|
||||
protected void setupConfig()
|
||||
{
|
||||
|
||||
IInventory upgrades = this.upgradeable.getInventoryByName( "upgrades" );
|
||||
final IInventory upgrades = this.upgradeable.getInventoryByName( "upgrades" );
|
||||
if( this.availableUpgrades() > 0 )
|
||||
{
|
||||
this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8, this.invPlayer ) ).setNotDraggable() );
|
||||
@@ -93,9 +93,9 @@ public class ContainerLevelEmitter extends ContainerUpgradeable
|
||||
this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 3, 187, 8 + 18 * 3, this.invPlayer ) ).setNotDraggable() );
|
||||
}
|
||||
|
||||
IInventory inv = this.upgradeable.getInventoryByName( "config" );
|
||||
int y = 40;
|
||||
int x = 80 + 44;
|
||||
final IInventory inv = this.upgradeable.getInventoryByName( "config" );
|
||||
final int y = 40;
|
||||
final int x = 80 + 44;
|
||||
this.addSlotToContainer( new SlotFakeTypeOnly( inv, 0, x, y ) );
|
||||
}
|
||||
|
||||
@@ -130,7 +130,7 @@ public class ContainerLevelEmitter extends ContainerUpgradeable
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate( String field, Object oldValue, Object newValue )
|
||||
public void onUpdate( final String field, final Object oldValue, final Object newValue )
|
||||
{
|
||||
if( field.equals( "EmitterValue" ) )
|
||||
{
|
||||
|
||||
@@ -45,17 +45,17 @@ public class ContainerMAC extends ContainerUpgradeable implements IProgressProvi
|
||||
@GuiSync( 4 )
|
||||
public int craftProgress = 0;
|
||||
|
||||
public ContainerMAC( InventoryPlayer ip, TileMolecularAssembler te )
|
||||
public ContainerMAC( final InventoryPlayer ip, final TileMolecularAssembler te )
|
||||
{
|
||||
super( ip, te );
|
||||
this.tma = te;
|
||||
}
|
||||
|
||||
public boolean isValidItemForSlot( int slotIndex, ItemStack i )
|
||||
public boolean isValidItemForSlot( final int slotIndex, final ItemStack i )
|
||||
{
|
||||
IInventory mac = this.upgradeable.getInventoryByName( "mac" );
|
||||
final IInventory mac = this.upgradeable.getInventoryByName( "mac" );
|
||||
|
||||
ItemStack is = mac.getStackInSlot( 10 );
|
||||
final ItemStack is = mac.getStackInSlot( 10 );
|
||||
if( is == null )
|
||||
{
|
||||
return false;
|
||||
@@ -63,9 +63,9 @@ public class ContainerMAC extends ContainerUpgradeable implements IProgressProvi
|
||||
|
||||
if( is.getItem() instanceof ItemEncodedPattern )
|
||||
{
|
||||
World w = this.getTileEntity().getWorld();
|
||||
ItemEncodedPattern iep = (ItemEncodedPattern) is.getItem();
|
||||
ICraftingPatternDetails ph = iep.getPatternForItem( is, w );
|
||||
final World w = this.getTileEntity().getWorld();
|
||||
final ItemEncodedPattern iep = (ItemEncodedPattern) is.getItem();
|
||||
final ICraftingPatternDetails ph = iep.getPatternForItem( is, w );
|
||||
if( ph.isCraftable() )
|
||||
{
|
||||
return ph.isValidItemForSlot( slotIndex, i, w );
|
||||
@@ -87,13 +87,13 @@ public class ContainerMAC extends ContainerUpgradeable implements IProgressProvi
|
||||
int offX = 29;
|
||||
int offY = 30;
|
||||
|
||||
IInventory mac = this.upgradeable.getInventoryByName( "mac" );
|
||||
final IInventory mac = this.upgradeable.getInventoryByName( "mac" );
|
||||
|
||||
for( int y = 0; y < 3; y++ )
|
||||
{
|
||||
for( int x = 0; x < 3; x++ )
|
||||
{
|
||||
SlotMACPattern s = new SlotMACPattern( this, mac, x + y * 3, offX + x * 18, offY + y * 18 );
|
||||
final SlotMACPattern s = new SlotMACPattern( this, mac, x + y * 3, offX + x * 18, offY + y * 18 );
|
||||
this.addSlotToContainer( s );
|
||||
}
|
||||
}
|
||||
@@ -107,7 +107,7 @@ public class ContainerMAC extends ContainerUpgradeable implements IProgressProvi
|
||||
offX = 122;
|
||||
offY = 17;
|
||||
|
||||
IInventory upgrades = this.upgradeable.getInventoryByName( "upgrades" );
|
||||
final IInventory upgrades = this.upgradeable.getInventoryByName( "upgrades" );
|
||||
this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8, this.invPlayer ) ).setNotDraggable() );
|
||||
this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 1, 187, 8 + 18, this.invPlayer ) ).setNotDraggable() );
|
||||
this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 2, 187, 8 + 18 * 2, this.invPlayer ) ).setNotDraggable() );
|
||||
|
||||
@@ -84,12 +84,12 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa
|
||||
IConfigManager serverCM;
|
||||
private IGridNode networkNode;
|
||||
|
||||
public ContainerMEMonitorable( InventoryPlayer ip, ITerminalHost monitorable )
|
||||
public ContainerMEMonitorable( final InventoryPlayer ip, final ITerminalHost monitorable )
|
||||
{
|
||||
this( ip, monitorable, true );
|
||||
}
|
||||
|
||||
protected ContainerMEMonitorable( InventoryPlayer ip, ITerminalHost monitorable, boolean bindInventory )
|
||||
protected ContainerMEMonitorable( final InventoryPlayer ip, final ITerminalHost monitorable, final boolean bindInventory )
|
||||
{
|
||||
super( ip, monitorable instanceof TileEntity ? (TileEntity) monitorable : null, monitorable instanceof IPart ? (IPart) monitorable : null );
|
||||
|
||||
@@ -121,11 +121,11 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa
|
||||
}
|
||||
else if( monitorable instanceof IGridHost )
|
||||
{
|
||||
IGridNode node = ( (IGridHost) monitorable ).getGridNode( AEPartLocation.INTERNAL );
|
||||
final IGridNode node = ( (IGridHost) monitorable ).getGridNode( AEPartLocation.INTERNAL );
|
||||
if( node != null )
|
||||
{
|
||||
this.networkNode = node;
|
||||
IGrid g = node.getGrid();
|
||||
final IGrid g = node.getGrid();
|
||||
if( g != null )
|
||||
{
|
||||
this.powerSrc = new ChannelPowerSrc( this.networkNode, (IEnergySource) g.getCache( IEnergyGrid.class ) );
|
||||
@@ -175,21 +175,21 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa
|
||||
this.isContainerValid = false;
|
||||
}
|
||||
|
||||
for( Settings set : this.serverCM.getSettings() )
|
||||
for( final Settings set : this.serverCM.getSettings() )
|
||||
{
|
||||
Enum<?> sideLocal = this.serverCM.getSetting( set );
|
||||
Enum<?> sideRemote = this.clientCM.getSetting( set );
|
||||
final Enum<?> sideLocal = this.serverCM.getSetting( set );
|
||||
final Enum<?> sideRemote = this.clientCM.getSetting( set );
|
||||
|
||||
if( sideLocal != sideRemote )
|
||||
{
|
||||
this.clientCM.putSetting( set, sideLocal );
|
||||
for( Object crafter : this.crafters )
|
||||
for( final Object crafter : this.crafters )
|
||||
{
|
||||
try
|
||||
{
|
||||
NetworkHandler.instance.sendTo( new PacketValueConfig( set.name(), sideLocal.name() ), (EntityPlayerMP) crafter );
|
||||
}
|
||||
catch( IOException e )
|
||||
catch( final IOException e )
|
||||
{
|
||||
AELog.error( e );
|
||||
}
|
||||
@@ -201,13 +201,13 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa
|
||||
{
|
||||
try
|
||||
{
|
||||
IItemList<IAEItemStack> monitorCache = this.monitor.getStorageList();
|
||||
final IItemList<IAEItemStack> monitorCache = this.monitor.getStorageList();
|
||||
|
||||
PacketMEInventoryUpdate piu = new PacketMEInventoryUpdate();
|
||||
final PacketMEInventoryUpdate piu = new PacketMEInventoryUpdate();
|
||||
|
||||
for( IAEItemStack is : this.items )
|
||||
for( final IAEItemStack is : this.items )
|
||||
{
|
||||
IAEItemStack send = monitorCache.findPrecise( is );
|
||||
final IAEItemStack send = monitorCache.findPrecise( is );
|
||||
if( send == null )
|
||||
{
|
||||
is.setStackSize( 0 );
|
||||
@@ -223,7 +223,7 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa
|
||||
{
|
||||
this.items.resetStatus();
|
||||
|
||||
for( Object c : this.crafters )
|
||||
for( final Object c : this.crafters )
|
||||
{
|
||||
if( c instanceof EntityPlayer )
|
||||
{
|
||||
@@ -232,7 +232,7 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa
|
||||
}
|
||||
}
|
||||
}
|
||||
catch( IOException e )
|
||||
catch( final IOException e )
|
||||
{
|
||||
AELog.error( e );
|
||||
}
|
||||
@@ -240,7 +240,7 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa
|
||||
|
||||
this.updatePowerStatus();
|
||||
|
||||
boolean oldAccessible = this.canAccessViewCells;
|
||||
final boolean oldAccessible = this.canAccessViewCells;
|
||||
this.canAccessViewCells = this.hasAccess( SecurityPermissions.BUILD, false );
|
||||
if( this.canAccessViewCells != oldAccessible )
|
||||
{
|
||||
@@ -274,14 +274,14 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa
|
||||
this.hasPower = this.powerSrc.extractAEPower( 1, Actionable.SIMULATE, PowerMultiplier.CONFIG ) > 0.8;
|
||||
}
|
||||
}
|
||||
catch( Throwable t )
|
||||
catch( final Throwable t )
|
||||
{
|
||||
// :P
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate( String field, Object oldValue, Object newValue )
|
||||
public void onUpdate( final String field, final Object oldValue, final Object newValue )
|
||||
{
|
||||
if( field.equals( "canAccessViewCells" ) )
|
||||
{
|
||||
@@ -298,29 +298,29 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCraftGuiOpened( ICrafting c )
|
||||
public void onCraftGuiOpened( final ICrafting c )
|
||||
{
|
||||
super.onCraftGuiOpened( c );
|
||||
|
||||
this.queueInventory( c );
|
||||
}
|
||||
|
||||
public void queueInventory( ICrafting c )
|
||||
public void queueInventory( final ICrafting c )
|
||||
{
|
||||
if( Platform.isServer() && c instanceof EntityPlayer && this.monitor != null )
|
||||
{
|
||||
try
|
||||
{
|
||||
PacketMEInventoryUpdate piu = new PacketMEInventoryUpdate();
|
||||
IItemList<IAEItemStack> monitorCache = this.monitor.getStorageList();
|
||||
final IItemList<IAEItemStack> monitorCache = this.monitor.getStorageList();
|
||||
|
||||
for( IAEItemStack send : monitorCache )
|
||||
for( final IAEItemStack send : monitorCache )
|
||||
{
|
||||
try
|
||||
{
|
||||
piu.appendItem( send );
|
||||
}
|
||||
catch( BufferOverflowException boe )
|
||||
catch( final BufferOverflowException boe )
|
||||
{
|
||||
NetworkHandler.instance.sendTo( piu, (EntityPlayerMP) c );
|
||||
|
||||
@@ -331,7 +331,7 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa
|
||||
|
||||
NetworkHandler.instance.sendTo( piu, (EntityPlayerMP) c );
|
||||
}
|
||||
catch( IOException e )
|
||||
catch( final IOException e )
|
||||
{
|
||||
AELog.error( e );
|
||||
}
|
||||
@@ -339,7 +339,7 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeCraftingFromCrafters( ICrafting c )
|
||||
public void removeCraftingFromCrafters( final ICrafting c )
|
||||
{
|
||||
super.removeCraftingFromCrafters( c );
|
||||
|
||||
@@ -350,7 +350,7 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onContainerClosed( EntityPlayer player )
|
||||
public void onContainerClosed( final EntityPlayer player )
|
||||
{
|
||||
super.onContainerClosed( player );
|
||||
if( this.monitor != null )
|
||||
@@ -360,15 +360,15 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid( Object verificationToken )
|
||||
public boolean isValid( final Object verificationToken )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postChange( IBaseMonitor<IAEItemStack> monitor, Iterable<IAEItemStack> change, BaseActionSource source )
|
||||
public void postChange( final IBaseMonitor<IAEItemStack> monitor, final Iterable<IAEItemStack> change, final BaseActionSource source )
|
||||
{
|
||||
for( IAEItemStack is : change )
|
||||
for( final IAEItemStack is : change )
|
||||
{
|
||||
this.items.add( is );
|
||||
}
|
||||
@@ -377,18 +377,18 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa
|
||||
@Override
|
||||
public void onListUpdate()
|
||||
{
|
||||
for( Object c : this.crafters )
|
||||
for( final Object c : this.crafters )
|
||||
{
|
||||
if( c instanceof ICrafting )
|
||||
{
|
||||
ICrafting cr = (ICrafting) c;
|
||||
final ICrafting cr = (ICrafting) c;
|
||||
this.queueInventory( cr );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateSetting( IConfigManager manager, Enum settingName, Enum newValue )
|
||||
public void updateSetting( final IConfigManager manager, final Enum settingName, final Enum newValue )
|
||||
{
|
||||
if( this.gui != null )
|
||||
{
|
||||
@@ -408,7 +408,7 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa
|
||||
|
||||
public ItemStack[] getViewCells()
|
||||
{
|
||||
ItemStack[] list = new ItemStack[this.cellView.length];
|
||||
final ItemStack[] list = new ItemStack[this.cellView.length];
|
||||
|
||||
for( int x = 0; x < this.cellView.length; x++ )
|
||||
{
|
||||
|
||||
@@ -37,12 +37,12 @@ public class ContainerMEPortableCell extends ContainerMEMonitorable
|
||||
private int ticks = 0;
|
||||
private final int slot;
|
||||
|
||||
public ContainerMEPortableCell( InventoryPlayer ip, IPortableCell monitorable )
|
||||
public ContainerMEPortableCell( final InventoryPlayer ip, final IPortableCell monitorable )
|
||||
{
|
||||
super( ip, monitorable, false );
|
||||
if( monitorable instanceof IInventorySlotAware )
|
||||
{
|
||||
int slotIndex = ( (IInventorySlotAware) monitorable ).getInventorySlot();
|
||||
final int slotIndex = ( (IInventorySlotAware) monitorable ).getInventorySlot();
|
||||
this.lockPlayerInventorySlot( slotIndex );
|
||||
this.slot = slotIndex;
|
||||
}
|
||||
@@ -58,7 +58,7 @@ public class ContainerMEPortableCell extends ContainerMEMonitorable
|
||||
@Override
|
||||
public void detectAndSendChanges()
|
||||
{
|
||||
ItemStack currentItem = this.slot < 0 ? this.getPlayerInv().getCurrentItem() : this.getPlayerInv().getStackInSlot( this.slot );
|
||||
final ItemStack currentItem = this.slot < 0 ? this.getPlayerInv().getCurrentItem() : this.getPlayerInv().getStackInSlot( this.slot );
|
||||
|
||||
if( this.civ != null )
|
||||
{
|
||||
|
||||
@@ -57,15 +57,15 @@ public class ContainerNetworkStatus extends AEBaseContainer
|
||||
IGrid network;
|
||||
int delay = 40;
|
||||
|
||||
public ContainerNetworkStatus( InventoryPlayer ip, INetworkTool te )
|
||||
public ContainerNetworkStatus( final InventoryPlayer ip, final INetworkTool te )
|
||||
{
|
||||
super( ip, null, null );
|
||||
IGridHost host = te.getGridHost();
|
||||
final IGridHost host = te.getGridHost();
|
||||
|
||||
if( host != null )
|
||||
{
|
||||
this.findNode( host, AEPartLocation.INTERNAL );
|
||||
for( AEPartLocation d : AEPartLocation.SIDE_LOCATIONS )
|
||||
for( final AEPartLocation d : AEPartLocation.SIDE_LOCATIONS )
|
||||
{
|
||||
this.findNode( host, d );
|
||||
}
|
||||
@@ -77,11 +77,11 @@ public class ContainerNetworkStatus extends AEBaseContainer
|
||||
}
|
||||
}
|
||||
|
||||
private void findNode( IGridHost host, AEPartLocation d )
|
||||
private void findNode( final IGridHost host, final AEPartLocation d )
|
||||
{
|
||||
if( this.network == null )
|
||||
{
|
||||
IGridNode node = host.getGridNode( d );
|
||||
final IGridNode node = host.getGridNode( d );
|
||||
if( node != null )
|
||||
{
|
||||
this.network = node.getGrid();
|
||||
@@ -97,7 +97,7 @@ public class ContainerNetworkStatus extends AEBaseContainer
|
||||
{
|
||||
this.delay = 0;
|
||||
|
||||
IEnergyGrid eg = this.network.getCache( IEnergyGrid.class );
|
||||
final IEnergyGrid eg = this.network.getCache( IEnergyGrid.class );
|
||||
if( eg != null )
|
||||
{
|
||||
this.avgAddition = (long) ( 100.0 * eg.getAvgPowerInjection() );
|
||||
@@ -108,31 +108,31 @@ public class ContainerNetworkStatus extends AEBaseContainer
|
||||
|
||||
try
|
||||
{
|
||||
PacketMEInventoryUpdate piu = new PacketMEInventoryUpdate();
|
||||
final PacketMEInventoryUpdate piu = new PacketMEInventoryUpdate();
|
||||
|
||||
for( Class<? extends IGridHost> machineClass : this.network.getMachinesClasses() )
|
||||
for( final Class<? extends IGridHost> machineClass : this.network.getMachinesClasses() )
|
||||
{
|
||||
IItemList<IAEItemStack> list = AEApi.instance().storage().createItemList();
|
||||
for( IGridNode machine : this.network.getMachines( machineClass ) )
|
||||
final IItemList<IAEItemStack> list = AEApi.instance().storage().createItemList();
|
||||
for( final IGridNode machine : this.network.getMachines( machineClass ) )
|
||||
{
|
||||
IGridBlock blk = machine.getGridBlock();
|
||||
ItemStack is = blk.getMachineRepresentation();
|
||||
final IGridBlock blk = machine.getGridBlock();
|
||||
final ItemStack is = blk.getMachineRepresentation();
|
||||
if( is != null && is.getItem() != null )
|
||||
{
|
||||
IAEItemStack ais = AEItemStack.create( is );
|
||||
final IAEItemStack ais = AEItemStack.create( is );
|
||||
ais.setStackSize( 1 );
|
||||
ais.setCountRequestable( (long) ( blk.getIdlePowerUsage() * 100.0 ) );
|
||||
list.add( ais );
|
||||
}
|
||||
}
|
||||
|
||||
for( IAEItemStack ais : list )
|
||||
for( final IAEItemStack ais : list )
|
||||
{
|
||||
piu.appendItem( ais );
|
||||
}
|
||||
}
|
||||
|
||||
for( Object c : this.crafters )
|
||||
for( final Object c : this.crafters )
|
||||
{
|
||||
if( c instanceof EntityPlayer )
|
||||
{
|
||||
@@ -140,7 +140,7 @@ public class ContainerNetworkStatus extends AEBaseContainer
|
||||
}
|
||||
}
|
||||
}
|
||||
catch( IOException e )
|
||||
catch( final IOException e )
|
||||
{
|
||||
// :P
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ public class ContainerNetworkTool extends AEBaseContainer
|
||||
@GuiSync( 1 )
|
||||
public boolean facadeMode;
|
||||
|
||||
public ContainerNetworkTool( InventoryPlayer ip, INetworkTool te )
|
||||
public ContainerNetworkTool( final InventoryPlayer ip, final INetworkTool te )
|
||||
{
|
||||
super( ip, null, null );
|
||||
this.toolInv = te;
|
||||
@@ -57,7 +57,7 @@ public class ContainerNetworkTool extends AEBaseContainer
|
||||
|
||||
public void toggleFacadeMode()
|
||||
{
|
||||
NBTTagCompound data = Platform.openNbtData( this.toolInv.getItemStack() );
|
||||
final NBTTagCompound data = Platform.openNbtData( this.toolInv.getItemStack() );
|
||||
data.setBoolean( "hideFacades", !data.getBoolean( "hideFacades" ) );
|
||||
this.detectAndSendChanges();
|
||||
}
|
||||
@@ -65,7 +65,7 @@ public class ContainerNetworkTool extends AEBaseContainer
|
||||
@Override
|
||||
public void detectAndSendChanges()
|
||||
{
|
||||
ItemStack currentItem = this.getPlayerInv().getCurrentItem();
|
||||
final ItemStack currentItem = this.getPlayerInv().getCurrentItem();
|
||||
|
||||
if( currentItem != this.toolInv.getItemStack() )
|
||||
{
|
||||
@@ -88,7 +88,7 @@ public class ContainerNetworkTool extends AEBaseContainer
|
||||
|
||||
if( this.isContainerValid )
|
||||
{
|
||||
NBTTagCompound data = Platform.openNbtData( currentItem );
|
||||
final NBTTagCompound data = Platform.openNbtData( currentItem );
|
||||
this.facadeMode = data.getBoolean( "hideFacades" );
|
||||
}
|
||||
|
||||
|
||||
@@ -80,13 +80,13 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA
|
||||
@GuiSync( 97 )
|
||||
public boolean craftingMode = true;
|
||||
|
||||
public ContainerPatternTerm( InventoryPlayer ip, ITerminalHost monitorable )
|
||||
public ContainerPatternTerm( final InventoryPlayer ip, final ITerminalHost monitorable )
|
||||
{
|
||||
super( ip, monitorable, false );
|
||||
this.ct = (PartPatternTerminal) monitorable;
|
||||
|
||||
IInventory patternInv = this.ct.getInventoryByName( "pattern" );
|
||||
IInventory output = this.ct.getInventoryByName( "output" );
|
||||
final IInventory patternInv = this.ct.getInventoryByName( "pattern" );
|
||||
final IInventory output = this.ct.getInventoryByName( "output" );
|
||||
this.crafting = this.ct.getInventoryByName( "crafting" );
|
||||
|
||||
for( int y = 0; y < 3; y++ )
|
||||
@@ -139,14 +139,14 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA
|
||||
}
|
||||
|
||||
@Override
|
||||
public void putStackInSlot( int par1, ItemStack par2ItemStack )
|
||||
public void putStackInSlot( final int par1, final ItemStack par2ItemStack )
|
||||
{
|
||||
super.putStackInSlot( par1, par2ItemStack );
|
||||
this.getAndUpdateOutput();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void putStacksInSlots( ItemStack[] par1ArrayOfItemStack )
|
||||
public void putStacksInSlots( final ItemStack[] par1ArrayOfItemStack )
|
||||
{
|
||||
super.putStacksInSlots( par1ArrayOfItemStack );
|
||||
this.getAndUpdateOutput();
|
||||
@@ -154,13 +154,13 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA
|
||||
|
||||
public ItemStack getAndUpdateOutput()
|
||||
{
|
||||
InventoryCrafting ic = new InventoryCrafting( this, 3, 3 );
|
||||
final InventoryCrafting ic = new InventoryCrafting( this, 3, 3 );
|
||||
for( int x = 0; x < ic.getSizeInventory(); x++ )
|
||||
{
|
||||
ic.setInventorySlotContents( x, this.crafting.getStackInSlot( x ) );
|
||||
}
|
||||
|
||||
ItemStack is = CraftingManager.getInstance().findMatchingRecipe( ic, this.getPlayerInv().player.worldObj );
|
||||
final ItemStack is = CraftingManager.getInstance().findMatchingRecipe( ic, this.getPlayerInv().player.worldObj );
|
||||
this.cOut.setInventorySlotContents( 0, is );
|
||||
return is;
|
||||
}
|
||||
@@ -172,7 +172,7 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA
|
||||
}
|
||||
|
||||
@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 )
|
||||
{
|
||||
|
||||
}
|
||||
@@ -181,8 +181,8 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA
|
||||
{
|
||||
ItemStack output = this.patternSlotOUT.getStack();
|
||||
|
||||
ItemStack[] in = this.getInputs();
|
||||
ItemStack[] out = this.getOutputs();
|
||||
final ItemStack[] in = this.getInputs();
|
||||
final ItemStack[] out = this.getOutputs();
|
||||
|
||||
// if there is no input, this would be silly.
|
||||
if( in == null || out == null )
|
||||
@@ -211,7 +211,7 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA
|
||||
}
|
||||
|
||||
// add a new encoded pattern.
|
||||
for( ItemStack encodedPatternStack : AEApi.instance().definitions().items().encodedPattern().maybeStack( 1 ).asSet() )
|
||||
for( final ItemStack encodedPatternStack : AEApi.instance().definitions().items().encodedPattern().maybeStack( 1 ).asSet() )
|
||||
{
|
||||
output = encodedPatternStack;
|
||||
this.patternSlotOUT.putStack( output );
|
||||
@@ -219,17 +219,17 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA
|
||||
}
|
||||
|
||||
// encode the slot.
|
||||
NBTTagCompound encodedValue = new NBTTagCompound();
|
||||
final NBTTagCompound encodedValue = new NBTTagCompound();
|
||||
|
||||
NBTTagList tagIn = new NBTTagList();
|
||||
NBTTagList tagOut = new NBTTagList();
|
||||
final NBTTagList tagIn = new NBTTagList();
|
||||
final NBTTagList tagOut = new NBTTagList();
|
||||
|
||||
for( ItemStack i : in )
|
||||
for( final ItemStack i : in )
|
||||
{
|
||||
tagIn.appendTag( this.createItemTag( i ) );
|
||||
}
|
||||
|
||||
for( ItemStack i : out )
|
||||
for( final ItemStack i : out )
|
||||
{
|
||||
tagOut.appendTag( this.createItemTag( i ) );
|
||||
}
|
||||
@@ -243,7 +243,7 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA
|
||||
|
||||
private ItemStack[] getInputs()
|
||||
{
|
||||
ItemStack[] input = new ItemStack[9];
|
||||
final ItemStack[] input = new ItemStack[9];
|
||||
boolean hasValue = false;
|
||||
|
||||
for( int x = 0; x < this.craftingSlots.length; x++ )
|
||||
@@ -267,7 +267,7 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA
|
||||
{
|
||||
if( this.craftingMode )
|
||||
{
|
||||
ItemStack out = this.getAndUpdateOutput();
|
||||
final ItemStack out = this.getAndUpdateOutput();
|
||||
if( out != null && out.stackSize > 0 )
|
||||
{
|
||||
return new ItemStack[] { out };
|
||||
@@ -275,12 +275,12 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA
|
||||
}
|
||||
else
|
||||
{
|
||||
List<ItemStack> list = new ArrayList<ItemStack>( 3 );
|
||||
final List<ItemStack> list = new ArrayList<ItemStack>( 3 );
|
||||
boolean hasValue = false;
|
||||
|
||||
for( OptionalSlotFake outputSlot : this.outputSlots )
|
||||
for( final OptionalSlotFake outputSlot : this.outputSlots )
|
||||
{
|
||||
ItemStack out = outputSlot.getStack();
|
||||
final ItemStack out = outputSlot.getStack();
|
||||
if( out != null && out.stackSize > 0 )
|
||||
{
|
||||
list.add( out );
|
||||
@@ -297,7 +297,7 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA
|
||||
return null;
|
||||
}
|
||||
|
||||
private boolean isPattern( ItemStack output )
|
||||
private boolean isPattern( final ItemStack output )
|
||||
{
|
||||
if( output == null )
|
||||
{
|
||||
@@ -312,9 +312,9 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA
|
||||
return isPattern;
|
||||
}
|
||||
|
||||
private NBTBase createItemTag( ItemStack i )
|
||||
private NBTBase createItemTag( final ItemStack i )
|
||||
{
|
||||
NBTTagCompound c = new NBTTagCompound();
|
||||
final NBTTagCompound c = new NBTTagCompound();
|
||||
|
||||
if( i != null )
|
||||
{
|
||||
@@ -325,7 +325,7 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSlotEnabled( int idx )
|
||||
public boolean isSlotEnabled( final int idx )
|
||||
{
|
||||
if( idx == 1 )
|
||||
{
|
||||
@@ -341,14 +341,14 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA
|
||||
}
|
||||
}
|
||||
|
||||
public void craftOrGetItem( PacketPatternSlot packetPatternSlot )
|
||||
public void craftOrGetItem( final PacketPatternSlot packetPatternSlot )
|
||||
{
|
||||
if( packetPatternSlot.slotItem != null && this.cellInv != null )
|
||||
{
|
||||
IAEItemStack out = packetPatternSlot.slotItem.copy();
|
||||
final IAEItemStack out = packetPatternSlot.slotItem.copy();
|
||||
|
||||
InventoryAdaptor inv = new AdaptorPlayerHand( this.getPlayerInv().player );
|
||||
InventoryAdaptor playerInv = InventoryAdaptor.getAdaptor( this.getPlayerInv().player, EnumFacing.UP );
|
||||
final InventoryAdaptor playerInv = InventoryAdaptor.getAdaptor( this.getPlayerInv().player, EnumFacing.UP );
|
||||
if( packetPatternSlot.shift )
|
||||
{
|
||||
inv = playerInv;
|
||||
@@ -359,8 +359,8 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA
|
||||
return;
|
||||
}
|
||||
|
||||
IAEItemStack extracted = Platform.poweredExtraction( this.powerSrc, this.cellInv, out, this.mySrc );
|
||||
EntityPlayer p = this.getPlayerInv().player;
|
||||
final IAEItemStack extracted = Platform.poweredExtraction( this.powerSrc, this.cellInv, out, this.mySrc );
|
||||
final EntityPlayer p = this.getPlayerInv().player;
|
||||
|
||||
if( extracted != null )
|
||||
{
|
||||
@@ -373,44 +373,44 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA
|
||||
return;
|
||||
}
|
||||
|
||||
InventoryCrafting ic = new InventoryCrafting( new ContainerNull(), 3, 3 );
|
||||
InventoryCrafting real = new InventoryCrafting( new ContainerNull(), 3, 3 );
|
||||
final InventoryCrafting ic = new InventoryCrafting( new ContainerNull(), 3, 3 );
|
||||
final InventoryCrafting real = new InventoryCrafting( new ContainerNull(), 3, 3 );
|
||||
for( int x = 0; x < 9; x++ )
|
||||
{
|
||||
ic.setInventorySlotContents( x, packetPatternSlot.pattern[x] == null ? null : packetPatternSlot.pattern[x].getItemStack() );
|
||||
}
|
||||
|
||||
IRecipe r = Platform.findMatchingRecipe( ic, p.worldObj );
|
||||
final IRecipe r = Platform.findMatchingRecipe( ic, p.worldObj );
|
||||
|
||||
if( r == null )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
IMEMonitor<IAEItemStack> storage = this.ct.getItemInventory();
|
||||
IItemList<IAEItemStack> all = storage.getStorageList();
|
||||
final IMEMonitor<IAEItemStack> storage = this.ct.getItemInventory();
|
||||
final IItemList<IAEItemStack> all = storage.getStorageList();
|
||||
|
||||
ItemStack is = r.getCraftingResult( ic );
|
||||
final ItemStack is = r.getCraftingResult( ic );
|
||||
|
||||
for( int x = 0; x < ic.getSizeInventory(); x++ )
|
||||
{
|
||||
if( ic.getStackInSlot( x ) != null )
|
||||
{
|
||||
ItemStack pulled = Platform.extractItemsByRecipe( this.powerSrc, this.mySrc, storage, p.worldObj, r, is, ic, ic.getStackInSlot( x ), x, all, Actionable.MODULATE, ItemViewCell.createFilter( this.getViewCells() ) );
|
||||
final ItemStack pulled = Platform.extractItemsByRecipe( this.powerSrc, this.mySrc, storage, p.worldObj, r, is, ic, ic.getStackInSlot( x ), x, all, Actionable.MODULATE, ItemViewCell.createFilter( this.getViewCells() ) );
|
||||
real.setInventorySlotContents( x, pulled );
|
||||
}
|
||||
}
|
||||
|
||||
IRecipe rr = Platform.findMatchingRecipe( real, p.worldObj );
|
||||
final IRecipe rr = Platform.findMatchingRecipe( real, p.worldObj );
|
||||
|
||||
if( rr == r && Platform.isSameItemPrecise( rr.getCraftingResult( real ), is ) )
|
||||
{
|
||||
SlotCrafting sc = new SlotCrafting( p, real, this.cOut, 0, 0, 0 );
|
||||
final SlotCrafting sc = new SlotCrafting( p, real, this.cOut, 0, 0, 0 );
|
||||
sc.onPickupFromSlot( p, is );
|
||||
|
||||
for( int x = 0; x < real.getSizeInventory(); x++ )
|
||||
{
|
||||
ItemStack failed = playerInv.addItems( real.getStackInSlot( x ) );
|
||||
final ItemStack failed = playerInv.addItems( real.getStackInSlot( x ) );
|
||||
if( failed != null )
|
||||
{
|
||||
p.dropPlayerItemWithRandomChoice( failed, false );
|
||||
@@ -428,7 +428,7 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA
|
||||
{
|
||||
for( int x = 0; x < real.getSizeInventory(); x++ )
|
||||
{
|
||||
ItemStack failed = real.getStackInSlot( x );
|
||||
final ItemStack failed = real.getStackInSlot( x );
|
||||
if( failed != null )
|
||||
{
|
||||
this.cellInv.injectItems( AEItemStack.create( failed ), Actionable.MODULATE, new MachineSource( this.ct ) );
|
||||
@@ -453,7 +453,7 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate( String field, Object oldValue, Object newValue )
|
||||
public void onUpdate( final String field, final Object oldValue, final Object newValue )
|
||||
{
|
||||
super.onUpdate( field, oldValue, newValue );
|
||||
|
||||
@@ -465,19 +465,19 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSlotChange( Slot s )
|
||||
public void onSlotChange( final Slot s )
|
||||
{
|
||||
if( s == this.patternSlotOUT && Platform.isServer() )
|
||||
{
|
||||
for( Object crafter : this.crafters )
|
||||
for( final Object crafter : this.crafters )
|
||||
{
|
||||
ICrafting icrafting = (ICrafting) crafter;
|
||||
final ICrafting icrafting = (ICrafting) crafter;
|
||||
|
||||
for( Object g : this.inventorySlots )
|
||||
for( final Object g : this.inventorySlots )
|
||||
{
|
||||
if( g instanceof OptionalSlotFake || g instanceof SlotFakeCraftingMatrix )
|
||||
{
|
||||
Slot sri = (Slot) g;
|
||||
final Slot sri = (Slot) g;
|
||||
icrafting.sendSlotContents( this, sri.slotNumber, sri.getStack() );
|
||||
}
|
||||
}
|
||||
@@ -489,12 +489,12 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA
|
||||
|
||||
public void clear()
|
||||
{
|
||||
for( Slot s : this.craftingSlots )
|
||||
for( final Slot s : this.craftingSlots )
|
||||
{
|
||||
s.putStack( null );
|
||||
}
|
||||
|
||||
for( Slot s : this.outputSlots )
|
||||
for( final Slot s : this.outputSlots )
|
||||
{
|
||||
s.putStack( null );
|
||||
}
|
||||
@@ -504,7 +504,7 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA
|
||||
}
|
||||
|
||||
@Override
|
||||
public IInventory getInventoryByName( String name )
|
||||
public IInventory getInventoryByName( final String name )
|
||||
{
|
||||
if( name.equals( "player" ) )
|
||||
{
|
||||
|
||||
@@ -43,20 +43,20 @@ public class ContainerPriority extends AEBaseContainer
|
||||
@GuiSync( 2 )
|
||||
public long PriorityValue = -1;
|
||||
|
||||
public ContainerPriority( InventoryPlayer ip, IPriorityHost te )
|
||||
public ContainerPriority( final InventoryPlayer ip, final IPriorityHost te )
|
||||
{
|
||||
super( ip, (TileEntity) ( te instanceof TileEntity ? te : null ), (IPart) ( te instanceof IPart ? te : null ) );
|
||||
this.priHost = te;
|
||||
}
|
||||
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void setTextField( GuiTextField level )
|
||||
public void setTextField( final GuiTextField level )
|
||||
{
|
||||
this.textField = level;
|
||||
this.textField.setText( String.valueOf( this.PriorityValue ) );
|
||||
}
|
||||
|
||||
public void setPriority( int newValue, EntityPlayer player )
|
||||
public void setPriority( final int newValue, final EntityPlayer player )
|
||||
{
|
||||
this.priHost.setPriority( newValue );
|
||||
this.PriorityValue = newValue;
|
||||
@@ -75,7 +75,7 @@ public class ContainerPriority extends AEBaseContainer
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate( String field, Object oldValue, Object newValue )
|
||||
public void onUpdate( final String field, final Object oldValue, final Object newValue )
|
||||
{
|
||||
if( field.equals( "PriorityValue" ) )
|
||||
{
|
||||
|
||||
@@ -30,7 +30,7 @@ public class ContainerQNB extends AEBaseContainer
|
||||
|
||||
final TileQuantumBridge quantumBridge;
|
||||
|
||||
public ContainerQNB( InventoryPlayer ip, TileQuantumBridge quantumBridge )
|
||||
public ContainerQNB( final InventoryPlayer ip, final TileQuantumBridge quantumBridge )
|
||||
{
|
||||
super( ip, quantumBridge, null );
|
||||
this.quantumBridge = quantumBridge;
|
||||
|
||||
@@ -48,7 +48,7 @@ public class ContainerQuartzKnife extends AEBaseContainer implements IAEAppEngIn
|
||||
final QuartzKnifeOutput output;
|
||||
String myName = "";
|
||||
|
||||
public ContainerQuartzKnife( InventoryPlayer ip, QuartzKnifeObj te )
|
||||
public ContainerQuartzKnife( final InventoryPlayer ip, final QuartzKnifeObj te )
|
||||
{
|
||||
super( ip, null, null );
|
||||
this.toolInv = te;
|
||||
@@ -61,7 +61,7 @@ public class ContainerQuartzKnife extends AEBaseContainer implements IAEAppEngIn
|
||||
this.bindPlayerInventory( ip, 0, 184 - /* height of player inventory */82 );
|
||||
}
|
||||
|
||||
public void setName( String value )
|
||||
public void setName( final String value )
|
||||
{
|
||||
this.myName = value;
|
||||
}
|
||||
@@ -69,7 +69,7 @@ public class ContainerQuartzKnife extends AEBaseContainer implements IAEAppEngIn
|
||||
@Override
|
||||
public void detectAndSendChanges()
|
||||
{
|
||||
ItemStack currentItem = this.getPlayerInv().getCurrentItem();
|
||||
final ItemStack currentItem = this.getPlayerInv().getCurrentItem();
|
||||
|
||||
if( currentItem != this.toolInv.getItemStack() )
|
||||
{
|
||||
@@ -94,7 +94,7 @@ public class ContainerQuartzKnife extends AEBaseContainer implements IAEAppEngIn
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onContainerClosed( EntityPlayer par1EntityPlayer )
|
||||
public void onContainerClosed( final EntityPlayer par1EntityPlayer )
|
||||
{
|
||||
if( this.inSlot.getStackInSlot( 0 ) != null )
|
||||
{
|
||||
@@ -109,7 +109,7 @@ public class ContainerQuartzKnife extends AEBaseContainer implements IAEAppEngIn
|
||||
}
|
||||
|
||||
@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 )
|
||||
{
|
||||
|
||||
}
|
||||
@@ -121,9 +121,9 @@ public class ContainerQuartzKnife extends AEBaseContainer implements IAEAppEngIn
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlot( int var1 )
|
||||
public ItemStack getStackInSlot( final int var1 )
|
||||
{
|
||||
ItemStack input = this.inSlot.getStackInSlot( 0 );
|
||||
final ItemStack input = this.inSlot.getStackInSlot( 0 );
|
||||
if( input == null )
|
||||
{
|
||||
return null;
|
||||
@@ -133,7 +133,7 @@ public class ContainerQuartzKnife extends AEBaseContainer implements IAEAppEngIn
|
||||
{
|
||||
if( this.myName.length() > 0 )
|
||||
{
|
||||
for( ItemStack namePressStack : AEApi.instance().definitions().materials().namePress().maybeStack( 1 ).asSet() )
|
||||
for( final ItemStack namePressStack : AEApi.instance().definitions().materials().namePress().maybeStack( 1 ).asSet() )
|
||||
{
|
||||
final NBTTagCompound compound = Platform.openNbtData( namePressStack );
|
||||
compound.setString( "InscribeName", this.myName );
|
||||
@@ -147,9 +147,9 @@ public class ContainerQuartzKnife extends AEBaseContainer implements IAEAppEngIn
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack decrStackSize( int var1, int var2 )
|
||||
public ItemStack decrStackSize( final int var1, final int var2 )
|
||||
{
|
||||
ItemStack is = this.getStackInSlot( 0 );
|
||||
final ItemStack is = this.getStackInSlot( 0 );
|
||||
if( is != null )
|
||||
{
|
||||
if( this.makePlate() )
|
||||
@@ -164,7 +164,7 @@ public class ContainerQuartzKnife extends AEBaseContainer implements IAEAppEngIn
|
||||
{
|
||||
if( this.inSlot.decrStackSize( 0, 1 ) != null )
|
||||
{
|
||||
ItemStack item = this.toolInv.getItemStack();
|
||||
final ItemStack item = this.toolInv.getItemStack();
|
||||
item.damageItem( 1, this.getPlayerInv().player );
|
||||
|
||||
if( item.stackSize == 0 )
|
||||
@@ -179,13 +179,13 @@ public class ContainerQuartzKnife extends AEBaseContainer implements IAEAppEngIn
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlotOnClosing( int var1 )
|
||||
public ItemStack getStackInSlotOnClosing( final int var1 )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInventorySlotContents( int var1, ItemStack var2 )
|
||||
public void setInventorySlotContents( final int var1, final ItemStack var2 )
|
||||
{
|
||||
if( var2 == null && Platform.isServer() )
|
||||
{
|
||||
@@ -218,27 +218,27 @@ public class ContainerQuartzKnife extends AEBaseContainer implements IAEAppEngIn
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUseableByPlayer( EntityPlayer var1 )
|
||||
public boolean isUseableByPlayer( final EntityPlayer var1 )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openInventory(
|
||||
EntityPlayer player )
|
||||
final EntityPlayer player )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void closeInventory(
|
||||
EntityPlayer player )
|
||||
final EntityPlayer player )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot( int var1, ItemStack var2 )
|
||||
public boolean isItemValidForSlot( final int var1, final ItemStack var2 )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -251,15 +251,15 @@ public class ContainerQuartzKnife extends AEBaseContainer implements IAEAppEngIn
|
||||
|
||||
@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 )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ public class ContainerSecurity extends ContainerMEMonitorable implements IAEAppE
|
||||
@GuiSync( 0 )
|
||||
public int security = 0;
|
||||
|
||||
public ContainerSecurity( InventoryPlayer ip, ITerminalHost monitorable )
|
||||
public ContainerSecurity( final InventoryPlayer ip, final ITerminalHost monitorable )
|
||||
{
|
||||
super( ip, monitorable, false );
|
||||
|
||||
@@ -67,16 +67,16 @@ public class ContainerSecurity extends ContainerMEMonitorable implements IAEAppE
|
||||
this.bindPlayerInventory( ip, 0, 0 );
|
||||
}
|
||||
|
||||
public void toggleSetting( String value, EntityPlayer player )
|
||||
public void toggleSetting( final String value, final EntityPlayer player )
|
||||
{
|
||||
try
|
||||
{
|
||||
SecurityPermissions permission = SecurityPermissions.valueOf( value );
|
||||
final SecurityPermissions permission = SecurityPermissions.valueOf( value );
|
||||
|
||||
ItemStack a = this.configSlot.getStack();
|
||||
final ItemStack a = this.configSlot.getStack();
|
||||
if( a != null && a.getItem() instanceof IBiometricCard )
|
||||
{
|
||||
IBiometricCard bc = (IBiometricCard) a.getItem();
|
||||
final IBiometricCard bc = (IBiometricCard) a.getItem();
|
||||
if( bc.hasPermission( a, permission ) )
|
||||
{
|
||||
bc.removePermission( a, permission );
|
||||
@@ -87,7 +87,7 @@ public class ContainerSecurity extends ContainerMEMonitorable implements IAEAppE
|
||||
}
|
||||
}
|
||||
}
|
||||
catch( EnumConstantNotPresentException ex )
|
||||
catch( final EnumConstantNotPresentException ex )
|
||||
{
|
||||
// :(
|
||||
}
|
||||
@@ -100,12 +100,12 @@ public class ContainerSecurity extends ContainerMEMonitorable implements IAEAppE
|
||||
|
||||
this.security = 0;
|
||||
|
||||
ItemStack a = this.configSlot.getStack();
|
||||
final ItemStack a = this.configSlot.getStack();
|
||||
if( a != null && a.getItem() instanceof IBiometricCard )
|
||||
{
|
||||
IBiometricCard bc = (IBiometricCard) a.getItem();
|
||||
final IBiometricCard bc = (IBiometricCard) a.getItem();
|
||||
|
||||
for( SecurityPermissions sp : bc.getPermissions( a ) )
|
||||
for( final SecurityPermissions sp : bc.getPermissions( a ) )
|
||||
{
|
||||
this.security |= ( 1 << sp.ordinal() );
|
||||
}
|
||||
@@ -117,7 +117,7 @@ public class ContainerSecurity extends ContainerMEMonitorable implements IAEAppE
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onContainerClosed( EntityPlayer player )
|
||||
public void onContainerClosed( final EntityPlayer player )
|
||||
{
|
||||
super.onContainerClosed( player );
|
||||
|
||||
@@ -139,13 +139,13 @@ public class ContainerSecurity extends ContainerMEMonitorable implements IAEAppE
|
||||
}
|
||||
|
||||
@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( !this.wirelessOut.getHasStack() )
|
||||
{
|
||||
if( this.wirelessIn.getHasStack() )
|
||||
{
|
||||
ItemStack term = this.wirelessIn.getStack().copy();
|
||||
final ItemStack term = this.wirelessIn.getStack().copy();
|
||||
INetworkEncodable networkEncodable = null;
|
||||
|
||||
if( term.getItem() instanceof INetworkEncodable )
|
||||
@@ -153,7 +153,7 @@ public class ContainerSecurity extends ContainerMEMonitorable implements IAEAppE
|
||||
networkEncodable = (INetworkEncodable) term.getItem();
|
||||
}
|
||||
|
||||
IWirelessTermHandler wTermHandler = AEApi.instance().registries().wireless().getWirelessTerminalHandler( term );
|
||||
final IWirelessTermHandler wTermHandler = AEApi.instance().registries().wireless().getWirelessTerminalHandler( term );
|
||||
if( wTermHandler != null )
|
||||
{
|
||||
networkEncodable = wTermHandler;
|
||||
@@ -167,9 +167,9 @@ public class ContainerSecurity extends ContainerMEMonitorable implements IAEAppE
|
||||
this.wirelessOut.putStack( term );
|
||||
|
||||
// update the two slots in question...
|
||||
for( Object crafter : this.crafters )
|
||||
for( final Object crafter : this.crafters )
|
||||
{
|
||||
ICrafting icrafting = (ICrafting) crafter;
|
||||
final ICrafting icrafting = (ICrafting) crafter;
|
||||
icrafting.sendSlotContents( this, this.wirelessIn.slotNumber, this.wirelessIn.getStack() );
|
||||
icrafting.sendSlotContents( this, this.wirelessOut.slotNumber, this.wirelessOut.getStack() );
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ public class ContainerSkyChest extends AEBaseContainer
|
||||
|
||||
final TileSkyChest chest;
|
||||
|
||||
public ContainerSkyChest( InventoryPlayer ip, TileSkyChest chest )
|
||||
public ContainerSkyChest( final InventoryPlayer ip, final TileSkyChest chest )
|
||||
{
|
||||
super( ip, chest, null );
|
||||
this.chest = chest;
|
||||
@@ -52,7 +52,7 @@ public class ContainerSkyChest extends AEBaseContainer
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onContainerClosed( EntityPlayer par1EntityPlayer )
|
||||
public void onContainerClosed( final EntityPlayer par1EntityPlayer )
|
||||
{
|
||||
super.onContainerClosed( par1EntityPlayer );
|
||||
this.chest.closeInventory(par1EntityPlayer);
|
||||
|
||||
@@ -48,7 +48,7 @@ public class ContainerSpatialIOPort extends AEBaseContainer
|
||||
IGrid network;
|
||||
int delay = 40;
|
||||
|
||||
public ContainerSpatialIOPort( InventoryPlayer ip, TileSpatialIOPort spatialIOPort )
|
||||
public ContainerSpatialIOPort( final InventoryPlayer ip, final TileSpatialIOPort spatialIOPort )
|
||||
{
|
||||
super( ip, spatialIOPort, null );
|
||||
this.spatialIOPort = spatialIOPort;
|
||||
@@ -76,8 +76,8 @@ public class ContainerSpatialIOPort extends AEBaseContainer
|
||||
{
|
||||
this.delay = 0;
|
||||
|
||||
IEnergyGrid eg = this.network.getCache( IEnergyGrid.class );
|
||||
ISpatialCache sc = this.network.getCache( ISpatialCache.class );
|
||||
final IEnergyGrid eg = this.network.getCache( IEnergyGrid.class );
|
||||
final ISpatialCache sc = this.network.getCache( ISpatialCache.class );
|
||||
if( eg != null )
|
||||
{
|
||||
this.currentPower = (long) ( 100.0 * eg.getStoredPower() );
|
||||
|
||||
@@ -54,7 +54,7 @@ public class ContainerStorageBus extends ContainerUpgradeable
|
||||
@GuiSync( 4 )
|
||||
public StorageFilter storageFilter = StorageFilter.EXTRACTABLE_ONLY;
|
||||
|
||||
public ContainerStorageBus( InventoryPlayer ip, PartStorageBus te )
|
||||
public ContainerStorageBus( final InventoryPlayer ip, final PartStorageBus te )
|
||||
{
|
||||
super( ip, te );
|
||||
this.storageBus = te;
|
||||
@@ -69,10 +69,10 @@ public class ContainerStorageBus extends ContainerUpgradeable
|
||||
@Override
|
||||
protected void setupConfig()
|
||||
{
|
||||
int xo = 8;
|
||||
int yo = 23 + 6;
|
||||
final int xo = 8;
|
||||
final int yo = 23 + 6;
|
||||
|
||||
IInventory config = this.upgradeable.getInventoryByName( "config" );
|
||||
final IInventory config = this.upgradeable.getInventoryByName( "config" );
|
||||
for( int y = 0; y < 7; y++ )
|
||||
{
|
||||
for( int x = 0; x < 9; x++ )
|
||||
@@ -88,7 +88,7 @@ public class ContainerStorageBus extends ContainerUpgradeable
|
||||
}
|
||||
}
|
||||
|
||||
IInventory upgrades = this.upgradeable.getInventoryByName( "upgrades" );
|
||||
final IInventory upgrades = this.upgradeable.getInventoryByName( "upgrades" );
|
||||
this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8, this.invPlayer ) ).setNotDraggable() );
|
||||
this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 1, 187, 8 + 18, this.invPlayer ) ).setNotDraggable() );
|
||||
this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 2, 187, 8 + 18 * 2, this.invPlayer ) ).setNotDraggable() );
|
||||
@@ -124,16 +124,16 @@ public class ContainerStorageBus extends ContainerUpgradeable
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSlotEnabled( int idx )
|
||||
public boolean isSlotEnabled( final int idx )
|
||||
{
|
||||
int upgrades = this.upgradeable.getInstalledUpgrades( Upgrades.CAPACITY );
|
||||
final int upgrades = this.upgradeable.getInstalledUpgrades( Upgrades.CAPACITY );
|
||||
|
||||
return upgrades > idx;
|
||||
}
|
||||
|
||||
public void clear()
|
||||
{
|
||||
IInventory inv = this.upgradeable.getInventoryByName( "config" );
|
||||
final IInventory inv = this.upgradeable.getInventoryByName( "config" );
|
||||
for( int x = 0; x < inv.getSizeInventory(); x++ )
|
||||
{
|
||||
inv.setInventorySlotContents( x, null );
|
||||
@@ -143,14 +143,14 @@ public class ContainerStorageBus extends ContainerUpgradeable
|
||||
|
||||
public void partition()
|
||||
{
|
||||
IInventory inv = this.upgradeable.getInventoryByName( "config" );
|
||||
final IInventory inv = this.upgradeable.getInventoryByName( "config" );
|
||||
|
||||
IMEInventory<IAEItemStack> cellInv = this.storageBus.getInternalHandler();
|
||||
final IMEInventory<IAEItemStack> cellInv = this.storageBus.getInternalHandler();
|
||||
|
||||
Iterator<IAEItemStack> i = new NullIterator<IAEItemStack>();
|
||||
if( cellInv != null )
|
||||
{
|
||||
IItemList<IAEItemStack> list = cellInv.getAvailableItems( AEApi.instance().storage().createItemList() );
|
||||
final IItemList<IAEItemStack> list = cellInv.getAvailableItems( AEApi.instance().storage().createItemList() );
|
||||
i = list.iterator();
|
||||
}
|
||||
|
||||
@@ -158,7 +158,7 @@ public class ContainerStorageBus extends ContainerUpgradeable
|
||||
{
|
||||
if( i.hasNext() && this.isSlotEnabled( ( x / 9 ) - 2 ) )
|
||||
{
|
||||
ItemStack g = i.next().getItemStack();
|
||||
final ItemStack g = i.next().getItemStack();
|
||||
g.stackSize = 1;
|
||||
inv.setInventorySlotContents( x, g );
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ public class ContainerUpgradeable extends AEBaseContainer implements IOptionalSl
|
||||
int tbSlot;
|
||||
NetworkToolViewer tbInventory;
|
||||
|
||||
public ContainerUpgradeable( InventoryPlayer ip, IUpgradeableHost te )
|
||||
public ContainerUpgradeable( final InventoryPlayer ip, final IUpgradeableHost te )
|
||||
{
|
||||
super( ip, (TileEntity) ( te instanceof TileEntity ? te : null ), (IPart) ( te instanceof IPart ? te : null ) );
|
||||
this.upgradeable = te;
|
||||
@@ -76,7 +76,7 @@ public class ContainerUpgradeable extends AEBaseContainer implements IOptionalSl
|
||||
|
||||
if( te instanceof TileEntity )
|
||||
{
|
||||
TileEntity myTile = (TileEntity) te;
|
||||
final TileEntity myTile = (TileEntity) te;
|
||||
w = myTile.getWorld();
|
||||
xCoord = myTile.getPos().getX();
|
||||
yCoord = myTile.getPos().getY();
|
||||
@@ -85,17 +85,17 @@ public class ContainerUpgradeable extends AEBaseContainer implements IOptionalSl
|
||||
|
||||
if( te instanceof IPart )
|
||||
{
|
||||
TileEntity mk = te.getTile();
|
||||
final TileEntity mk = te.getTile();
|
||||
w = mk.getWorld();
|
||||
xCoord = mk.getPos().getX();
|
||||
yCoord = mk.getPos().getY();
|
||||
zCoord = mk.getPos().getZ();
|
||||
}
|
||||
|
||||
IInventory pi = this.getPlayerInv();
|
||||
final IInventory pi = this.getPlayerInv();
|
||||
for( int x = 0; x < pi.getSizeInventory(); x++ )
|
||||
{
|
||||
ItemStack pii = pi.getStackInSlot( x );
|
||||
final ItemStack pii = pi.getStackInSlot( x );
|
||||
if( pii != null && pii.getItem() instanceof ToolNetworkTool )
|
||||
{
|
||||
this.lockPlayerInventorySlot( x );
|
||||
@@ -135,9 +135,9 @@ public class ContainerUpgradeable extends AEBaseContainer implements IOptionalSl
|
||||
{
|
||||
this.setupUpgrades();
|
||||
|
||||
IInventory inv = this.upgradeable.getInventoryByName( "config" );
|
||||
int y = 40;
|
||||
int x = 80;
|
||||
final IInventory inv = this.upgradeable.getInventoryByName( "config" );
|
||||
final int y = 40;
|
||||
final int x = 80;
|
||||
this.addSlotToContainer( new SlotFakeTypeOnly( inv, 0, x, y ) );
|
||||
|
||||
if( this.supportCapacity() )
|
||||
@@ -156,7 +156,7 @@ public class ContainerUpgradeable extends AEBaseContainer implements IOptionalSl
|
||||
|
||||
protected void setupUpgrades()
|
||||
{
|
||||
IInventory upgrades = this.upgradeable.getInventoryByName( "upgrades" );
|
||||
final IInventory upgrades = this.upgradeable.getInventoryByName( "upgrades" );
|
||||
if( this.availableUpgrades() > 0 )
|
||||
{
|
||||
this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8, this.invPlayer ) ).setNotDraggable() );
|
||||
@@ -192,17 +192,17 @@ public class ContainerUpgradeable extends AEBaseContainer implements IOptionalSl
|
||||
|
||||
if( Platform.isServer() )
|
||||
{
|
||||
IConfigManager cm = this.upgradeable.getConfigManager();
|
||||
final IConfigManager cm = this.upgradeable.getConfigManager();
|
||||
this.loadSettingsFromHost( cm );
|
||||
}
|
||||
|
||||
this.checkToolbox();
|
||||
|
||||
for( Object o : this.inventorySlots )
|
||||
for( final Object o : this.inventorySlots )
|
||||
{
|
||||
if( o instanceof OptionalSlotFake )
|
||||
{
|
||||
OptionalSlotFake fs = (OptionalSlotFake) o;
|
||||
final OptionalSlotFake fs = (OptionalSlotFake) o;
|
||||
if( !fs.isEnabled() && fs.getDisplayStack() != null )
|
||||
{
|
||||
fs.clearStack();
|
||||
@@ -213,7 +213,7 @@ public class ContainerUpgradeable extends AEBaseContainer implements IOptionalSl
|
||||
this.standardDetectAndSendChanges();
|
||||
}
|
||||
|
||||
protected void loadSettingsFromHost( IConfigManager cm )
|
||||
protected void loadSettingsFromHost( final IConfigManager cm )
|
||||
{
|
||||
this.fzMode = (FuzzyMode) cm.getSetting( Settings.FUZZY_MODE );
|
||||
this.rsMode = (RedstoneMode) cm.getSetting( Settings.REDSTONE_CONTROLLED );
|
||||
@@ -228,7 +228,7 @@ public class ContainerUpgradeable extends AEBaseContainer implements IOptionalSl
|
||||
{
|
||||
if( this.hasToolbox() )
|
||||
{
|
||||
ItemStack currentItem = this.getPlayerInv().getStackInSlot( this.tbSlot );
|
||||
final ItemStack currentItem = this.getPlayerInv().getStackInSlot( this.tbSlot );
|
||||
|
||||
if( currentItem != this.tbInventory.getItemStack() )
|
||||
{
|
||||
@@ -257,9 +257,9 @@ public class ContainerUpgradeable extends AEBaseContainer implements IOptionalSl
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSlotEnabled( int idx )
|
||||
public boolean isSlotEnabled( final int idx )
|
||||
{
|
||||
int upgrades = this.upgradeable.getInstalledUpgrades( Upgrades.CAPACITY );
|
||||
final int upgrades = this.upgradeable.getInstalledUpgrades( Upgrades.CAPACITY );
|
||||
|
||||
if( idx == 1 && upgrades > 0 )
|
||||
{
|
||||
|
||||
@@ -39,7 +39,7 @@ public class ContainerVibrationChamber extends AEBaseContainer implements IProgr
|
||||
@GuiSync( 1 )
|
||||
public int burnSpeed = 100;
|
||||
|
||||
public ContainerVibrationChamber( InventoryPlayer ip, TileVibrationChamber vibrationChamber )
|
||||
public ContainerVibrationChamber( final InventoryPlayer ip, final TileVibrationChamber vibrationChamber )
|
||||
{
|
||||
super( ip, vibrationChamber, null );
|
||||
this.vibrationChamber = vibrationChamber;
|
||||
|
||||
@@ -37,7 +37,7 @@ public class ContainerWireless extends AEBaseContainer
|
||||
@GuiSync( 2 )
|
||||
public long drain = 0;
|
||||
|
||||
public ContainerWireless( InventoryPlayer ip, TileWireless te )
|
||||
public ContainerWireless( final InventoryPlayer ip, final TileWireless te )
|
||||
{
|
||||
super( ip, te, null );
|
||||
this.wirelessTerminal = te;
|
||||
@@ -50,7 +50,7 @@ public class ContainerWireless extends AEBaseContainer
|
||||
@Override
|
||||
public void detectAndSendChanges()
|
||||
{
|
||||
int boosters = this.boosterSlot.getStack() == null ? 0 : this.boosterSlot.getStack().stackSize;
|
||||
final int boosters = this.boosterSlot.getStack() == null ? 0 : this.boosterSlot.getStack().stackSize;
|
||||
|
||||
this.range = (long) ( 10 * AEConfig.instance.wireless_getMaxRange( boosters ) );
|
||||
this.drain = (long) ( 100 * AEConfig.instance.wireless_getPowerDrain( boosters ) );
|
||||
|
||||
@@ -31,7 +31,7 @@ public class ContainerWirelessTerm extends ContainerMEPortableCell
|
||||
|
||||
final WirelessTerminalGuiObject wirelessTerminalGUIObject;
|
||||
|
||||
public ContainerWirelessTerm( InventoryPlayer ip, WirelessTerminalGuiObject gui )
|
||||
public ContainerWirelessTerm( final InventoryPlayer ip, final WirelessTerminalGuiObject gui )
|
||||
{
|
||||
super( ip, gui );
|
||||
this.wirelessTerminalGUIObject = gui;
|
||||
|
||||
@@ -33,7 +33,7 @@ public class CraftingCPURecord implements Comparable<CraftingCPURecord>
|
||||
final long size;
|
||||
final int processors;
|
||||
|
||||
public CraftingCPURecord( long size, int coProcessors, ICraftingCPU server )
|
||||
public CraftingCPURecord( final long size, final int coProcessors, final ICraftingCPU server )
|
||||
{
|
||||
this.size = size;
|
||||
this.processors = coProcessors;
|
||||
@@ -42,9 +42,9 @@ public class CraftingCPURecord implements Comparable<CraftingCPURecord>
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo( @Nonnull CraftingCPURecord o )
|
||||
public int compareTo( @Nonnull final CraftingCPURecord o )
|
||||
{
|
||||
int a = ItemSorters.compareLong( o.processors, this.processors );
|
||||
final int a = ItemSorters.compareLong( o.processors, this.processors );
|
||||
if( a != 0 )
|
||||
{
|
||||
return a;
|
||||
|
||||
Reference in New Issue
Block a user