final variables and parameters

This commit is contained in:
thatsIch
2015-09-30 14:24:40 +02:00
parent 059523f543
commit 8b3a954f73
732 changed files with 9253 additions and 9256 deletions
@@ -101,12 +101,12 @@ public abstract class AEBaseContainer extends Container
int ticksSinceCheck = 900;
IAEItemStack clientRequestedTargetItem = null;
public AEBaseContainer( InventoryPlayer ip, TileEntity myTile, IPart myPart )
public AEBaseContainer( final InventoryPlayer ip, final TileEntity myTile, final IPart myPart )
{
this( ip, myTile, myPart, null );
}
public AEBaseContainer( InventoryPlayer ip, TileEntity myTile, IPart myPart, IGuiItemObject gio )
public AEBaseContainer( final InventoryPlayer ip, final TileEntity myTile, final IPart myPart, final IGuiItemObject gio )
{
this.invPlayer = ip;
this.tileEntity = myTile;
@@ -138,11 +138,11 @@ public abstract class AEBaseContainer extends Container
private void prepareSync()
{
for( Field f : this.getClass().getFields() )
for( final Field f : this.getClass().getFields() )
{
if( f.isAnnotationPresent( GuiSync.class ) )
{
GuiSync annotation = f.getAnnotation( GuiSync.class );
final GuiSync annotation = f.getAnnotation( GuiSync.class );
if( this.syncData.containsKey( annotation.value() ) )
{
AELog.warning( "Channel already in use: " + annotation.value() + " for " + f.getName() );
@@ -155,7 +155,7 @@ public abstract class AEBaseContainer extends Container
}
}
public AEBaseContainer( InventoryPlayer ip, Object anchor )
public AEBaseContainer( final InventoryPlayer ip, final Object anchor )
{
this.invPlayer = ip;
this.tileEntity = anchor instanceof TileEntity ? (TileEntity) anchor : null;
@@ -172,7 +172,7 @@ public abstract class AEBaseContainer extends Container
this.prepareSync();
}
public void postPartial( PacketPartialItem packetPartialItem )
public void postPartial( final PacketPartialItem packetPartialItem )
{
this.dataChunks.add( packetPartialItem );
if( packetPartialItem.getPageCount() == this.dataChunks.size() )
@@ -184,28 +184,28 @@ public abstract class AEBaseContainer extends Container
private void parsePartials()
{
int total = 0;
for( PacketPartialItem ppi : this.dataChunks )
for( final PacketPartialItem ppi : this.dataChunks )
{
total += ppi.getSize();
}
byte[] buffer = new byte[total];
final byte[] buffer = new byte[total];
int cursor = 0;
for( PacketPartialItem ppi : this.dataChunks )
for( final PacketPartialItem ppi : this.dataChunks )
{
cursor = ppi.write( buffer, cursor );
}
try
{
NBTTagCompound data = CompressedStreamTools.readCompressed( new ByteArrayInputStream( buffer ) );
final NBTTagCompound data = CompressedStreamTools.readCompressed( new ByteArrayInputStream( buffer ) );
if( data != null )
{
this.setTargetStack( AEApi.instance().storage().createItemStack( ItemStack.loadItemStackFromNBT( data ) ) );
}
}
catch( IOException e )
catch( final IOException e )
{
AELog.error( e );
}
@@ -218,21 +218,21 @@ public abstract class AEBaseContainer extends Container
return this.clientRequestedTargetItem;
}
public void setTargetStack( IAEItemStack stack )
public void setTargetStack( final IAEItemStack stack )
{
// client doesn't need to re-send, makes for lower overhead rapid packets.
if( Platform.isClient() )
{
ItemStack a = stack == null ? null : stack.getItemStack();
ItemStack b = this.clientRequestedTargetItem == null ? null : this.clientRequestedTargetItem.getItemStack();
final ItemStack a = stack == null ? null : stack.getItemStack();
final ItemStack b = this.clientRequestedTargetItem == null ? null : this.clientRequestedTargetItem.getItemStack();
if( Platform.isSameItemPrecise( a, b ) )
{
return;
}
ByteArrayOutputStream stream = new ByteArrayOutputStream();
NBTTagCompound item = new NBTTagCompound();
final ByteArrayOutputStream stream = new ByteArrayOutputStream();
final NBTTagCompound item = new NBTTagCompound();
if( stack != null )
{
@@ -243,16 +243,16 @@ public abstract class AEBaseContainer extends Container
{
CompressedStreamTools.writeCompressed( item, stream );
int maxChunkSize = 30000;
List<byte[]> miniPackets = new LinkedList<byte[]>();
final int maxChunkSize = 30000;
final List<byte[]> miniPackets = new LinkedList<byte[]>();
byte[] data = stream.toByteArray();
final byte[] data = stream.toByteArray();
ByteArrayInputStream bis = new ByteArrayInputStream( data, 0, stream.size() );
final ByteArrayInputStream bis = new ByteArrayInputStream( data, 0, stream.size() );
while( bis.available() > 0 )
{
int nextBLock = bis.available() > maxChunkSize ? maxChunkSize : bis.available();
byte[] nextSegment = new byte[nextBLock];
final int nextBLock = bis.available() > maxChunkSize ? maxChunkSize : bis.available();
final byte[] nextSegment = new byte[nextBLock];
bis.read( nextSegment );
miniPackets.add( nextSegment );
}
@@ -260,14 +260,14 @@ public abstract class AEBaseContainer extends Container
stream.close();
int page = 0;
for( byte[] packet : miniPackets )
for( final byte[] packet : miniPackets )
{
PacketPartialItem ppi = new PacketPartialItem( page, miniPackets.size(), packet );
final PacketPartialItem ppi = new PacketPartialItem( page, miniPackets.size(), packet );
page++;
NetworkHandler.instance.sendToServer( ppi );
}
}
catch( IOException e )
catch( final IOException e )
{
AELog.error( e );
return;
@@ -282,7 +282,7 @@ public abstract class AEBaseContainer extends Container
return this.mySrc;
}
public void verifyPermissions( SecurityPermissions security, boolean requirePower )
public void verifyPermissions( final SecurityPermissions security, final boolean requirePower )
{
if( Platform.isClient() )
{
@@ -299,28 +299,28 @@ public abstract class AEBaseContainer extends Container
this.isContainerValid = this.isContainerValid && this.hasAccess( security, requirePower );
}
protected boolean hasAccess( SecurityPermissions perm, boolean requirePower )
protected boolean hasAccess( final SecurityPermissions perm, final boolean requirePower )
{
IActionHost host = this.getActionHost();
final IActionHost host = this.getActionHost();
if( host != null )
{
IGridNode gn = host.getActionableNode();
final IGridNode gn = host.getActionableNode();
if( gn != null )
{
IGrid g = gn.getGrid();
final IGrid g = gn.getGrid();
if( g != null )
{
if( requirePower )
{
IEnergyGrid eg = g.getCache( IEnergyGrid.class );
final IEnergyGrid eg = g.getCache( IEnergyGrid.class );
if( !eg.isNetworkPowered() )
{
return false;
}
}
ISecurityGrid sg = g.getCache( ISecurityGrid.class );
final ISecurityGrid sg = g.getCache( ISecurityGrid.class );
if( sg.hasPermission( this.invPlayer.player, perm ) )
{
return true;
@@ -332,7 +332,7 @@ public abstract class AEBaseContainer extends Container
return false;
}
public void lockPlayerInventorySlot( int idx )
public void lockPlayerInventorySlot( final int idx )
{
this.locked.add( idx );
}
@@ -364,7 +364,7 @@ public abstract class AEBaseContainer extends Container
return this.tileEntity;
}
public final void updateFullProgressBar( int idx, long value )
public final void updateFullProgressBar( final int idx, final long value )
{
if( this.syncData.containsKey( idx ) )
{
@@ -375,7 +375,7 @@ public abstract class AEBaseContainer extends Container
this.updateProgressBar( idx, (int) value );
}
public void stringSync( int idx, String value )
public void stringSync( final int idx, final String value )
{
if( this.syncData.containsKey( idx ) )
{
@@ -383,7 +383,7 @@ public abstract class AEBaseContainer extends Container
}
}
protected void bindPlayerInventory( InventoryPlayer inventoryPlayer, int offsetX, int offsetY )
protected void bindPlayerInventory( final InventoryPlayer inventoryPlayer, final int offsetX, final int offsetY )
{
// bind player inventory
for( int i = 0; i < 3; i++ )
@@ -416,11 +416,11 @@ public abstract class AEBaseContainer extends Container
}
@Override
protected Slot addSlotToContainer( Slot newSlot )
protected Slot addSlotToContainer( final Slot newSlot )
{
if( newSlot instanceof AppEngSlot )
{
AppEngSlot s = (AppEngSlot) newSlot;
final AppEngSlot s = (AppEngSlot) newSlot;
s.myContainer = this;
return super.addSlotToContainer( newSlot );
}
@@ -437,11 +437,11 @@ public abstract class AEBaseContainer extends Container
if( Platform.isServer() )
{
for( Object crafter : this.crafters )
for( final Object crafter : this.crafters )
{
ICrafting icrafting = (ICrafting) crafter;
final ICrafting icrafting = (ICrafting) crafter;
for( SyncData sd : this.syncData.values() )
for( final SyncData sd : this.syncData.values() )
{
sd.tick( icrafting );
}
@@ -452,7 +452,7 @@ public abstract class AEBaseContainer extends Container
}
@Override
public ItemStack transferStackInSlot( EntityPlayer p, int idx )
public ItemStack transferStackInSlot( final EntityPlayer p, final int idx )
{
if( Platform.isClient() )
{
@@ -460,7 +460,7 @@ public abstract class AEBaseContainer extends Container
}
boolean hasMETiles = false;
for( Object is : this.inventorySlots )
for( final Object is : this.inventorySlots )
{
if( is instanceof InternalSlotME )
{
@@ -474,7 +474,7 @@ public abstract class AEBaseContainer extends Container
return null;
}
AppEngSlot clickSlot = (AppEngSlot) this.inventorySlots.get( idx ); // require AE SLots!
final AppEngSlot clickSlot = (AppEngSlot) this.inventorySlots.get( idx ); // require AE SLots!
if( clickSlot instanceof SlotDisabled || clickSlot instanceof SlotInaccessible )
{
@@ -489,7 +489,7 @@ public abstract class AEBaseContainer extends Container
return null;
}
List<Slot> selectedSlots = new ArrayList<Slot>();
final List<Slot> selectedSlots = new ArrayList<Slot>();
/**
* Gather a list of valid destinations.
@@ -499,9 +499,9 @@ public abstract class AEBaseContainer extends Container
tis = this.shiftStoreItem( tis );
// target slots in the container...
for( Object inventorySlot : this.inventorySlots )
for( final Object inventorySlot : this.inventorySlots )
{
AppEngSlot cs = (AppEngSlot) inventorySlot;
final AppEngSlot cs = (AppEngSlot) inventorySlot;
if( !( cs.isPlayerSide() ) && !( cs instanceof SlotFake ) && !( cs instanceof SlotCraftingMatrix ) )
{
@@ -515,9 +515,9 @@ public abstract class AEBaseContainer extends Container
else
{
// target slots in the container...
for( Object inventorySlot : this.inventorySlots )
for( final Object inventorySlot : this.inventorySlots )
{
AppEngSlot cs = (AppEngSlot) inventorySlot;
final AppEngSlot cs = (AppEngSlot) inventorySlot;
if( ( cs.isPlayerSide() ) && !( cs instanceof SlotFake ) && !( cs instanceof SlotCraftingMatrix ) )
{
@@ -537,10 +537,10 @@ public abstract class AEBaseContainer extends Container
if( tis != null )
{
// target slots in the container...
for( Object inventorySlot : this.inventorySlots )
for( final Object inventorySlot : this.inventorySlots )
{
AppEngSlot cs = (AppEngSlot) inventorySlot;
ItemStack destination = cs.getStack();
final AppEngSlot cs = (AppEngSlot) inventorySlot;
final ItemStack destination = cs.getStack();
if( !( cs.isPlayerSide() ) && cs instanceof SlotFake )
{
@@ -563,7 +563,7 @@ public abstract class AEBaseContainer extends Container
if( tis != null )
{
// find partials..
for( Slot d : selectedSlots )
for( final Slot d : selectedSlots )
{
if( d instanceof SlotDisabled || d instanceof SlotME )
{
@@ -574,7 +574,7 @@ public abstract class AEBaseContainer extends Container
{
if( d.getHasStack() )
{
ItemStack t = d.getStack();
final ItemStack t = d.getStack();
if( Platform.isSameItemPrecise( tis, t ) ) // t.isItemEqual(tis))
{
@@ -615,7 +615,7 @@ public abstract class AEBaseContainer extends Container
}
// any match..
for( Slot d : selectedSlots )
for( final Slot d : selectedSlots )
{
if( d instanceof SlotDisabled || d instanceof SlotME )
{
@@ -626,7 +626,7 @@ public abstract class AEBaseContainer extends Container
{
if( d.getHasStack() )
{
ItemStack t = d.getStack();
final ItemStack t = d.getStack();
if( Platform.isSameItemPrecise( t, tis ) )
{
@@ -673,7 +673,7 @@ public abstract class AEBaseContainer extends Container
maxSize = d.getSlotStackLimit();
}
ItemStack tmp = tis.copy();
final ItemStack tmp = tis.copy();
if( tmp.stackSize > maxSize )
{
tmp.stackSize = maxSize;
@@ -712,7 +712,7 @@ public abstract class AEBaseContainer extends Container
}
@Override
public final void updateProgressBar( int idx, int value )
public final void updateProgressBar( final int idx, final int value )
{
if( this.syncData.containsKey( idx ) )
{
@@ -721,7 +721,7 @@ public abstract class AEBaseContainer extends Container
}
@Override
public boolean canInteractWith( EntityPlayer entityplayer )
public boolean canInteractWith( final EntityPlayer entityplayer )
{
if( this.isContainerValid )
{
@@ -735,16 +735,16 @@ public abstract class AEBaseContainer extends Container
}
@Override
public boolean canDragIntoSlot( Slot s )
public boolean canDragIntoSlot( final Slot s )
{
return ( (AppEngSlot) s ).isDraggable;
}
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 )
{
if( slot >= 0 && slot < this.inventorySlots.size() )
{
Slot s = this.getSlot( slot );
final Slot s = this.getSlot( slot );
if( s instanceof SlotCraftingTerm )
{
@@ -761,7 +761,7 @@ public abstract class AEBaseContainer extends Container
if( s instanceof SlotFake )
{
ItemStack hand = player.inventory.getItemStack();
final ItemStack hand = player.inventory.getItemStack();
switch( action )
{
@@ -781,7 +781,7 @@ public abstract class AEBaseContainer extends Container
if( hand != null )
{
ItemStack is = hand.copy();
final ItemStack is = hand.copy();
is.stackSize = 1;
s.putStack( is );
}
@@ -826,9 +826,9 @@ public abstract class AEBaseContainer extends Container
if( action == InventoryAction.MOVE_REGION )
{
List<Slot> from = new LinkedList<Slot>();
final List<Slot> from = new LinkedList<Slot>();
for( Object j : this.inventorySlots )
for( final Object j : this.inventorySlots )
{
if( j instanceof Slot && j.getClass() == s.getClass() )
{
@@ -836,7 +836,7 @@ public abstract class AEBaseContainer extends Container
}
}
for( Slot fr : from )
for( final Slot fr : from )
{
this.transferStackInSlot( player, fr.slotNumber );
}
@@ -846,7 +846,7 @@ public abstract class AEBaseContainer extends Container
}
// get target item.
IAEItemStack slotItem = this.clientRequestedTargetItem;
final IAEItemStack slotItem = this.clientRequestedTargetItem;
switch( action )
{
@@ -863,7 +863,7 @@ public abstract class AEBaseContainer extends Container
ais.setStackSize( myItem.getMaxStackSize() );
InventoryAdaptor adp = InventoryAdaptor.getAdaptor( player, EnumFacing.UP );
final InventoryAdaptor adp = InventoryAdaptor.getAdaptor( player, EnumFacing.UP );
myItem.stackSize = (int) ais.getStackSize();
myItem = adp.simulateAdd( myItem );
@@ -885,21 +885,21 @@ public abstract class AEBaseContainer extends Container
return;
}
int releaseQty = 1;
ItemStack isg = player.inventory.getItemStack();
final int releaseQty = 1;
final ItemStack isg = player.inventory.getItemStack();
if( isg != null && releaseQty > 0 )
{
IAEItemStack ais = AEApi.instance().storage().createItemStack( isg );
ais.setStackSize( 1 );
IAEItemStack extracted = ais.copy();
final IAEItemStack extracted = ais.copy();
ais = Platform.poweredInsert( this.powerSrc, this.cellInv, ais, this.mySrc );
if( ais == null )
{
InventoryAdaptor ia = new AdaptorPlayerHand( player );
final InventoryAdaptor ia = new AdaptorPlayerHand( player );
ItemStack fail = ia.removeItems( 1, extracted.getItemStack(), null );
final ItemStack fail = ia.removeItems( 1, extracted.getItemStack(), null );
if( fail == null )
{
this.cellInv.extractItems( extracted, Actionable.MODULATE, this.mySrc );
@@ -920,7 +920,7 @@ public abstract class AEBaseContainer extends Container
if( slotItem != null )
{
int liftQty = 1;
ItemStack item = player.inventory.getItemStack();
final ItemStack item = player.inventory.getItemStack();
if( item != null )
{
@@ -941,9 +941,9 @@ public abstract class AEBaseContainer extends Container
ais = Platform.poweredExtraction( this.powerSrc, this.cellInv, ais, this.mySrc );
if( ais != null )
{
InventoryAdaptor ia = new AdaptorPlayerHand( player );
final InventoryAdaptor ia = new AdaptorPlayerHand( player );
ItemStack fail = ia.addItems( ais.getItemStack() );
final ItemStack fail = ia.addItems( ais.getItemStack() );
if( fail != null )
{
this.cellInv.injectItems( ais, Actionable.MODULATE, this.mySrc );
@@ -1005,13 +1005,13 @@ public abstract class AEBaseContainer extends Container
if( slotItem != null )
{
IAEItemStack ais = slotItem.copy();
long maxSize = ais.getItemStack().getMaxStackSize();
final long maxSize = ais.getItemStack().getMaxStackSize();
ais.setStackSize( maxSize );
ais = this.cellInv.extractItems( ais, Actionable.SIMULATE, this.mySrc );
if( ais != null )
{
long stackSize = Math.min( maxSize, ais.getStackSize() );
final long stackSize = Math.min( maxSize, ais.getStackSize() );
ais.setStackSize( ( stackSize + 1 ) >> 1 );
ais = Platform.poweredExtraction( this.powerSrc, this.cellInv, ais, this.mySrc );
}
@@ -1034,7 +1034,7 @@ public abstract class AEBaseContainer extends Container
ais = Platform.poweredInsert( this.powerSrc, this.cellInv, ais, this.mySrc );
if( ais == null )
{
ItemStack is = player.inventory.getItemStack();
final ItemStack is = player.inventory.getItemStack();
is.stackSize--;
if( is.stackSize <= 0 )
{
@@ -1048,7 +1048,7 @@ public abstract class AEBaseContainer extends Container
case CREATIVE_DUPLICATE:
if( player.capabilities.isCreativeMode && slotItem != null )
{
ItemStack is = slotItem.getItemStack();
final ItemStack is = slotItem.getItemStack();
is.stackSize = is.getMaxStackSize();
player.inventory.setItemStack( is );
this.updateHeld( player );
@@ -1063,7 +1063,7 @@ public abstract class AEBaseContainer extends Container
if( slotItem != null )
{
int playerInv = 9 * 4;
final int playerInv = 9 * 4;
for( int slotNum = 0; slotNum < playerInv; slotNum++ )
{
IAEItemStack ais = slotItem.copy();
@@ -1071,7 +1071,7 @@ public abstract class AEBaseContainer extends Container
ais.setStackSize( myItem.getMaxStackSize() );
InventoryAdaptor adp = InventoryAdaptor.getAdaptor( player, EnumFacing.UP );
final InventoryAdaptor adp = InventoryAdaptor.getAdaptor( player, EnumFacing.UP );
myItem.stackSize = (int) ais.getStackSize();
myItem = adp.simulateAdd( myItem );
@@ -1098,7 +1098,7 @@ public abstract class AEBaseContainer extends Container
}
}
protected void updateHeld( EntityPlayerMP p )
protected void updateHeld( final EntityPlayerMP p )
{
if( Platform.isServer() )
{
@@ -1106,20 +1106,20 @@ public abstract class AEBaseContainer extends Container
{
NetworkHandler.instance.sendTo( new PacketInventoryAction( InventoryAction.UPDATE_HAND, 0, AEItemStack.create( p.inventory.getItemStack() ) ), p );
}
catch( IOException e )
catch( final IOException e )
{
AELog.error( e );
}
}
}
public ItemStack shiftStoreItem( ItemStack input )
public ItemStack shiftStoreItem( final ItemStack input )
{
if( this.powerSrc == null || this.cellInv == null )
{
return input;
}
IAEItemStack ais = Platform.poweredInsert( this.powerSrc, this.cellInv, AEApi.instance().storage().createItemStack( input ), this.mySrc );
final IAEItemStack ais = Platform.poweredInsert( this.powerSrc, this.cellInv, AEApi.instance().storage().createItemStack( input ), this.mySrc );
if( ais == null )
{
return null;
@@ -1127,7 +1127,7 @@ public abstract class AEBaseContainer extends Container
return ais.getItemStack();
}
private void updateSlot( Slot clickSlot )
private void updateSlot( final Slot clickSlot )
{
// ???
this.detectAndSendChanges();
@@ -1175,7 +1175,7 @@ public abstract class AEBaseContainer extends Container
{
NetworkHandler.instance.sendTo( new PacketValueConfig( "CustomName", this.customName ), (EntityPlayerMP) this.invPlayer.player );
}
catch( IOException e )
catch( final IOException e )
{
AELog.error( e );
}
@@ -1185,10 +1185,10 @@ public abstract class AEBaseContainer extends Container
}
}
public void swapSlotContents( int slotA, int slotB )
public void swapSlotContents( final int slotA, final int slotB )
{
Slot a = this.getSlot( slotA );
Slot b = this.getSlot( slotB );
final Slot a = this.getSlot( slotA );
final Slot b = this.getSlot( slotB );
// NPE protection...
if( a == null || b == null )
@@ -1196,8 +1196,8 @@ public abstract class AEBaseContainer extends Container
return;
}
ItemStack isA = a.getStack();
ItemStack isB = b.getStack();
final ItemStack isA = a.getStack();
final ItemStack isB = b.getStack();
// something to do?
if( isA == null && isB == null )
@@ -1240,7 +1240,7 @@ public abstract class AEBaseContainer extends Container
return;
}
int totalA = testA.stackSize;
final int totalA = testA.stackSize;
testA.stackSize = a.getSlotStackLimit();
testB = testA.copy();
@@ -1254,7 +1254,7 @@ public abstract class AEBaseContainer extends Container
return;
}
int totalB = testB.stackSize;
final int totalB = testB.stackSize;
testB.stackSize = b.getSlotStackLimit();
testA = testB.copy();
@@ -1265,17 +1265,17 @@ public abstract class AEBaseContainer extends Container
b.putStack( testB );
}
public void onUpdate( String field, Object oldValue, Object newValue )
public void onUpdate( final String field, final Object oldValue, final Object newValue )
{
}
public void onSlotChange( Slot s )
public void onSlotChange( final Slot s )
{
}
public boolean isValidForSlot( Slot s, ItemStack i )
public boolean isValidForSlot( final Slot s, final ItemStack i )
{
return true;
}
@@ -30,7 +30,7 @@ public class ContainerNull extends Container
{
@Override
public boolean canInteractWith( EntityPlayer entityplayer )
public boolean canInteractWith( final EntityPlayer entityplayer )
{
return false;
}
@@ -36,9 +36,9 @@ public class ContainerOpenContext
public int z;
public AEPartLocation side;
public ContainerOpenContext( Object myItem )
public ContainerOpenContext( final Object myItem )
{
boolean isWorld = myItem instanceof IPart || myItem instanceof TileEntity;
final boolean isWorld = myItem instanceof IPart || myItem instanceof TileEntity;
this.isItem = !isWorld;
}
@@ -40,7 +40,7 @@ public class SyncData
private final int channel;
private Object clientVersion;
public SyncData( AEBaseContainer container, Field field, GuiSync annotation )
public SyncData( final AEBaseContainer container, final Field field, final GuiSync annotation )
{
this.clientVersion = null;
this.source = container;
@@ -53,11 +53,11 @@ public class SyncData
return this.channel;
}
public void tick( ICrafting c )
public void tick( final ICrafting c )
{
try
{
Object val = this.field.get( this.source );
final Object val = this.field.get( this.source );
if( val != null && this.clientVersion == null )
{
this.send( c, val );
@@ -67,21 +67,21 @@ public class SyncData
this.send( c, val );
}
}
catch( IllegalArgumentException e )
catch( final IllegalArgumentException e )
{
AELog.error( e );
}
catch( IllegalAccessException e )
catch( final IllegalAccessException e )
{
AELog.error( e );
}
catch( IOException e )
catch( final IOException e )
{
AELog.error( e );
}
}
private void send( ICrafting o, Object val ) throws IOException
private void send( final ICrafting o, final Object val ) throws IOException
{
if( val instanceof String )
{
@@ -110,11 +110,11 @@ public class SyncData
this.clientVersion = val;
}
public void update( Object val )
public void update( final Object val )
{
try
{
Object oldValue = this.field.get( this.source );
final Object oldValue = this.field.get( this.source );
if( val instanceof String )
{
this.updateString( oldValue, (String) val );
@@ -124,40 +124,40 @@ public class SyncData
this.updateValue( oldValue, (Long) val );
}
}
catch( IllegalArgumentException e )
catch( final IllegalArgumentException e )
{
AELog.error( e );
}
catch( IllegalAccessException e )
catch( final IllegalAccessException e )
{
AELog.error( e );
}
}
private void updateString( Object oldValue, String val )
private void updateString( final Object oldValue, final String val )
{
try
{
this.field.set( this.source, val );
}
catch( IllegalArgumentException e )
catch( final IllegalArgumentException e )
{
AELog.error( e );
}
catch( IllegalAccessException e )
catch( final IllegalAccessException e )
{
AELog.error( e );
}
}
private void updateValue( Object oldValue, long val )
private void updateValue( final Object oldValue, final long val )
{
try
{
if( this.field.getType().isEnum() )
{
EnumSet<? extends Enum> valList = EnumSet.allOf( (Class<? extends Enum>) this.field.getType() );
for( Enum e : valList )
final EnumSet<? extends Enum> valList = EnumSet.allOf( (Class<? extends Enum>) this.field.getType() );
for( final Enum e : valList )
{
if( e.ordinal() == val )
{
@@ -196,11 +196,11 @@ public class SyncData
this.source.onUpdate( this.field.getName(), oldValue, this.field.get( this.source ) );
}
catch( IllegalArgumentException e )
catch( final IllegalArgumentException e )
{
AELog.error( e );
}
catch( IllegalAccessException e )
catch( final IllegalAccessException e )
{
AELog.error( e );
}
@@ -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;
@@ -52,7 +52,7 @@ public class AppEngCraftingSlot extends AppEngSlot
*/
private int amountCrafted;
public AppEngCraftingSlot( EntityPlayer par1EntityPlayer, IInventory par2IInventory, IInventory par3IInventory, int par4, int par5, int par6 )
public AppEngCraftingSlot( final EntityPlayer par1EntityPlayer, final IInventory par2IInventory, final IInventory par3IInventory, final int par4, final int par5, final int par6 )
{
super( par3IInventory, par4, par5, par6 );
this.thePlayer = par1EntityPlayer;
@@ -63,7 +63,7 @@ public class AppEngCraftingSlot extends AppEngSlot
* Check if the stack is a valid item for this slot. Always true beside for the armor slots.
*/
@Override
public boolean isItemValid( ItemStack par1ItemStack )
public boolean isItemValid( final ItemStack par1ItemStack )
{
return false;
}
@@ -73,7 +73,7 @@ public class AppEngCraftingSlot extends AppEngSlot
* internal count then calls onCrafting(item).
*/
@Override
protected void onCrafting( ItemStack par1ItemStack, int par2 )
protected void onCrafting( final ItemStack par1ItemStack, final int par2 )
{
this.amountCrafted += par2;
this.onCrafting( par1ItemStack );
@@ -83,7 +83,7 @@ public class AppEngCraftingSlot extends AppEngSlot
* the itemStack passed in is the output - ie, iron ingots, and pickaxes, not ore and wood.
*/
@Override
protected void onCrafting( ItemStack par1ItemStack )
protected void onCrafting( final ItemStack par1ItemStack )
{
par1ItemStack.onCrafting( this.thePlayer.worldObj, this.thePlayer, this.amountCrafted );
this.amountCrafted = 0;
@@ -140,17 +140,17 @@ public class AppEngCraftingSlot extends AppEngSlot
}
@Override
public void onPickupFromSlot( EntityPlayer playerIn, ItemStack stack )
public void onPickupFromSlot( final EntityPlayer playerIn, final ItemStack stack )
{
net.minecraftforge.fml.common.FMLCommonHandler.instance().firePlayerCraftingEvent(playerIn, stack, craftMatrix);
this.onCrafting(stack);
net.minecraftforge.common.ForgeHooks.setCraftingPlayer(playerIn);
InventoryCrafting ic = new InventoryCrafting( this.myContainer, 3, 3 );
final InventoryCrafting ic = new InventoryCrafting( this.myContainer, 3, 3 );
for ( int x=0; x < this.craftMatrix.getSizeInventory(); x++ )
ic.setInventorySlotContents( x, this.craftMatrix.getStackInSlot( x ) );
ItemStack[] aitemstack = CraftingManager.getInstance().func_180303_b(ic, playerIn.worldObj);
final ItemStack[] aitemstack = CraftingManager.getInstance().func_180303_b(ic, playerIn.worldObj);
for ( int x=0; x < this.craftMatrix.getSizeInventory(); x++ )
craftMatrix.setInventorySlotContents( x, ic.getStackInSlot( x ) );
@@ -159,8 +159,8 @@ public class AppEngCraftingSlot extends AppEngSlot
for (int i = 0; i < aitemstack.length; ++i)
{
ItemStack itemstack1 = this.craftMatrix.getStackInSlot(i);
ItemStack itemstack2 = aitemstack[i];
final ItemStack itemstack1 = this.craftMatrix.getStackInSlot(i);
final ItemStack itemstack2 = aitemstack[i];
if (itemstack1 != null)
{
@@ -186,7 +186,7 @@ public class AppEngCraftingSlot extends AppEngSlot
* stack.
*/
@Override
public ItemStack decrStackSize( int par1 )
public ItemStack decrStackSize( final int par1 )
{
if( this.getHasStack() )
{
@@ -39,7 +39,7 @@ public class AppEngSlot extends Slot
public hasCalculatedValidness isValid;
public boolean isDisplay = false;
public AppEngSlot( IInventory inv, int idx, int x, int y )
public AppEngSlot( final IInventory inv, final int idx, final int x, final int y )
{
super( inv, idx, x, y );
this.defX = x;
@@ -70,7 +70,7 @@ public class AppEngSlot extends Slot
}
@Override
public boolean isItemValid( ItemStack par1ItemStack )
public boolean isItemValid( final ItemStack par1ItemStack )
{
if( this.isEnabled() )
{
@@ -101,7 +101,7 @@ public class AppEngSlot extends Slot
}
@Override
public void putStack( ItemStack par1ItemStack )
public void putStack( final ItemStack par1ItemStack )
{
if( this.isEnabled() )
{
@@ -130,7 +130,7 @@ public class AppEngSlot extends Slot
}
@Override
public boolean canTakeStack( EntityPlayer par1EntityPlayer )
public boolean canTakeStack( final EntityPlayer par1EntityPlayer )
{
if( this.isEnabled() )
{
@@ -34,19 +34,19 @@ public class NullSlot extends Slot
}
@Override
public void onSlotChange( ItemStack par1ItemStack, ItemStack par2ItemStack )
public void onSlotChange( final ItemStack par1ItemStack, final ItemStack par2ItemStack )
{
}
@Override
public void onPickupFromSlot( EntityPlayer par1EntityPlayer, ItemStack par2ItemStack )
public void onPickupFromSlot( final EntityPlayer par1EntityPlayer, final ItemStack par2ItemStack )
{
}
@Override
public boolean isItemValid( ItemStack par1ItemStack )
public boolean isItemValid( final ItemStack par1ItemStack )
{
return false;
}
@@ -58,7 +58,7 @@ public class NullSlot extends Slot
}
@Override
public void putStack( ItemStack par1ItemStack )
public void putStack( final ItemStack par1ItemStack )
{
}
@@ -76,19 +76,19 @@ public class NullSlot extends Slot
}
@Override
public ItemStack decrStackSize( int par1 )
public ItemStack decrStackSize( final int par1 )
{
return null;
}
@Override
public boolean isHere( IInventory inv, int slotIn )
public boolean isHere( final IInventory inv, final int slotIn )
{
return false;
}
@Override
public boolean canTakeStack( EntityPlayer par1EntityPlayer )
public boolean canTakeStack( final EntityPlayer par1EntityPlayer )
{
return false;
}
@@ -33,7 +33,7 @@ public class OptionalSlotFake extends SlotFake
final IOptionalSlotHost host;
public boolean renderDisabled = true;
public OptionalSlotFake( IInventory inv, IOptionalSlotHost containerBus, int idx, int x, int y, int offX, int offY, int groupNum )
public OptionalSlotFake( final IInventory inv, final IOptionalSlotHost containerBus, final int idx, final int x, final int y, final int offX, final int offY, final int groupNum )
{
super( inv, idx, x + offX * 18, y + offY * 18 );
this.srcX = x;
@@ -26,7 +26,7 @@ import net.minecraft.item.ItemStack;
public class OptionalSlotFakeTypeOnly extends OptionalSlotFake
{
public OptionalSlotFakeTypeOnly( IInventory inv, IOptionalSlotHost containerBus, int idx, int x, int y, int offX, int offY, int groupNum )
public OptionalSlotFakeTypeOnly( final IInventory inv, final IOptionalSlotHost containerBus, final int idx, final int x, final int y, final int offX, final int offY, final int groupNum )
{
super( inv, containerBus, idx, x, y, offX, offY, groupNum );
}
@@ -28,7 +28,7 @@ public class OptionalSlotNormal extends AppEngSlot
final int groupNum;
final IOptionalSlotHost host;
public OptionalSlotNormal( IInventory inv, IOptionalSlotHost containerBus, int slot, int xPos, int yPos, int groupNum )
public OptionalSlotNormal( final IInventory inv, final IOptionalSlotHost containerBus, final int slot, final int xPos, final int yPos, final int groupNum )
{
super( inv, slot, xPos, yPos );
this.groupNum = groupNum;
@@ -29,7 +29,7 @@ public class OptionalSlotRestrictedInput extends SlotRestrictedInput
final int groupNum;
final IOptionalSlotHost host;
public OptionalSlotRestrictedInput( PlacableItemType valid, IInventory i, IOptionalSlotHost host, int slotIndex, int x, int y, int grpNum, InventoryPlayer invPlayer )
public OptionalSlotRestrictedInput( final PlacableItemType valid, final IInventory i, final IOptionalSlotHost host, final int slotIndex, final int x, final int y, final int grpNum, final InventoryPlayer invPlayer )
{
super( valid, i, slotIndex, x, y, invPlayer );
this.groupNum = grpNum;
@@ -25,7 +25,7 @@ import net.minecraft.inventory.IInventory;
public class QuartzKnifeOutput extends SlotOutput
{
public QuartzKnifeOutput( IInventory a, int b, int c, int d, int i )
public QuartzKnifeOutput( final IInventory a, final int b, final int c, final int d, final int i )
{
super( a, b, c, d, i );
}
@@ -29,7 +29,7 @@ public class SlotCraftingMatrix extends AppEngSlot
final Container c;
public SlotCraftingMatrix( Container c, IInventory par1iInventory, int par2, int par3, int par4 )
public SlotCraftingMatrix( final Container c, final IInventory par1iInventory, final int par2, final int par3, final int par4 )
{
super( par1iInventory, par2, par3, par4 );
this.c = c;
@@ -43,7 +43,7 @@ public class SlotCraftingMatrix extends AppEngSlot
}
@Override
public void putStack( ItemStack par1ItemStack )
public void putStack( final ItemStack par1ItemStack )
{
super.putStack( par1ItemStack );
this.c.onCraftMatrixChanged( this.inventory );
@@ -56,9 +56,9 @@ public class SlotCraftingMatrix extends AppEngSlot
}
@Override
public ItemStack decrStackSize( int par1 )
public ItemStack decrStackSize( final int par1 )
{
ItemStack is = super.decrStackSize( par1 );
final ItemStack is = super.decrStackSize( par1 );
this.c.onCraftMatrixChanged( this.inventory );
return is;
}
@@ -57,7 +57,7 @@ public class SlotCraftingTerm extends AppEngCraftingSlot
private final IStorageMonitorable storage;
private final IContainerCraftingPacket container;
public SlotCraftingTerm( EntityPlayer player, BaseActionSource mySrc, IEnergySource energySrc, IStorageMonitorable storage, IInventory cMatrix, IInventory secondMatrix, IInventory output, int x, int y, IContainerCraftingPacket ccp )
public SlotCraftingTerm( final EntityPlayer player, final BaseActionSource mySrc, final IEnergySource energySrc, final IStorageMonitorable storage, final IInventory cMatrix, final IInventory secondMatrix, final IInventory output, final int x, final int y, final IContainerCraftingPacket ccp )
{
super( player, cMatrix, output, 0, x, y );
this.energySrc = energySrc;
@@ -74,17 +74,17 @@ public class SlotCraftingTerm extends AppEngCraftingSlot
}
@Override
public boolean canTakeStack( EntityPlayer par1EntityPlayer )
public boolean canTakeStack( final EntityPlayer par1EntityPlayer )
{
return false;
}
@Override
public void onPickupFromSlot( EntityPlayer p, ItemStack is )
public void onPickupFromSlot( final EntityPlayer p, final ItemStack is )
{
}
public void doClick( InventoryAction action, EntityPlayer who )
public void doClick( final InventoryAction action, final EntityPlayer who )
{
if( this.getStack() == null )
{
@@ -95,8 +95,8 @@ public class SlotCraftingTerm extends AppEngCraftingSlot
return;
}
IMEMonitor<IAEItemStack> inv = this.storage.getItemInventory();
int howManyPerCraft = this.getStack().stackSize;
final IMEMonitor<IAEItemStack> inv = this.storage.getItemInventory();
final int howManyPerCraft = this.getStack().stackSize;
int maxTimesToCraft = 0;
InventoryAdaptor ia = null;
@@ -124,7 +124,7 @@ public class SlotCraftingTerm extends AppEngCraftingSlot
return;
}
ItemStack rs = Platform.cloneItemStack( this.getStack() );
final ItemStack rs = Platform.cloneItemStack( this.getStack() );
if( rs == null )
{
return;
@@ -134,11 +134,11 @@ public class SlotCraftingTerm extends AppEngCraftingSlot
{
if( ia.simulateAdd( rs ) == null )
{
IItemList<IAEItemStack> all = inv.getStorageList();
ItemStack extra = ia.addItems( this.craftItem( who, rs, inv, all ) );
final IItemList<IAEItemStack> all = inv.getStorageList();
final ItemStack extra = ia.addItems( this.craftItem( who, rs, inv, all ) );
if( extra != null )
{
List<ItemStack> drops = new ArrayList<ItemStack>();
final List<ItemStack> drops = new ArrayList<ItemStack>();
drops.add( extra );
Platform.spawnDrops( who.worldObj, new BlockPos( (int) who.posX, (int) who.posY, (int) who.posZ ), drops );
return;
@@ -147,40 +147,40 @@ public class SlotCraftingTerm extends AppEngCraftingSlot
}
}
protected int capCraftingAttempts( int maxTimesToCraft )
protected int capCraftingAttempts( final int maxTimesToCraft )
{
return maxTimesToCraft;
}
public ItemStack craftItem( EntityPlayer p, ItemStack request, IMEMonitor<IAEItemStack> inv, IItemList all )
public ItemStack craftItem( final EntityPlayer p, final ItemStack request, final IMEMonitor<IAEItemStack> inv, final IItemList all )
{
// update crafting matrix...
ItemStack is = this.getStack();
if( is != null && Platform.isSameItem( request, is ) )
{
ItemStack[] set = new ItemStack[this.pattern.getSizeInventory()];
final ItemStack[] set = new ItemStack[this.pattern.getSizeInventory()];
// add one of each item to the items on the board...
if( Platform.isServer() )
{
InventoryCrafting ic = new InventoryCrafting( new ContainerNull(), 3, 3 );
final InventoryCrafting ic = new InventoryCrafting( new ContainerNull(), 3, 3 );
for( int x = 0; x < 9; x++ )
{
ic.setInventorySlotContents( x, this.pattern.getStackInSlot( x ) );
}
IRecipe r = Platform.findMatchingRecipe( ic, p.worldObj );
final IRecipe r = Platform.findMatchingRecipe( ic, p.worldObj );
if( r == null )
{
Item target = request.getItem();
final Item target = request.getItem();
if( target.isDamageable() && target.isRepairable() )
{
boolean isBad = false;
for( int x = 0; x < ic.getSizeInventory(); x++ )
{
ItemStack pis = ic.getStackInSlot( x );
final ItemStack pis = ic.getStackInSlot( x );
if( pis == null )
{
continue;
@@ -232,19 +232,19 @@ public class SlotCraftingTerm extends AppEngCraftingSlot
return null;
}
public boolean preCraft( EntityPlayer p, IMEMonitor<IAEItemStack> inv, ItemStack[] set, ItemStack result )
public boolean preCraft( final EntityPlayer p, final IMEMonitor<IAEItemStack> inv, final ItemStack[] set, final ItemStack result )
{
return true;
}
public void makeItem( EntityPlayer p, ItemStack is )
public void makeItem( final EntityPlayer p, final ItemStack is )
{
super.onPickupFromSlot( p, is );
}
public void postCraft( EntityPlayer p, IMEMonitor<IAEItemStack> inv, ItemStack[] set, ItemStack result )
public void postCraft( final EntityPlayer p, final IMEMonitor<IAEItemStack> inv, final ItemStack[] set, final ItemStack result )
{
List<ItemStack> drops = new ArrayList<ItemStack>();
final List<ItemStack> drops = new ArrayList<ItemStack>();
// add one of each item to the items on the board...
if( Platform.isServer() )
@@ -259,7 +259,7 @@ public class SlotCraftingTerm extends AppEngCraftingSlot
else if( set[x] != null )
{
// eek! put it back!
IAEItemStack fail = inv.injectItems( AEItemStack.create( set[x] ), Actionable.MODULATE, this.mySrc );
final IAEItemStack fail = inv.injectItems( AEItemStack.create( set[x] ), Actionable.MODULATE, this.mySrc );
if( fail != null )
{
drops.add( fail.getItemStack() );
@@ -27,19 +27,19 @@ import net.minecraft.item.ItemStack;
public class SlotDisabled extends AppEngSlot
{
public SlotDisabled( IInventory par1iInventory, int slotIndex, int x, int y )
public SlotDisabled( final IInventory par1iInventory, final int slotIndex, final int x, final int y )
{
super( par1iInventory, slotIndex, x, y );
}
@Override
public boolean isItemValid( ItemStack par1ItemStack )
public boolean isItemValid( final ItemStack par1ItemStack )
{
return false;
}
@Override
public boolean canTakeStack( EntityPlayer par1EntityPlayer )
public boolean canTakeStack( final EntityPlayer par1EntityPlayer )
{
return false;
}
@@ -29,25 +29,25 @@ public class SlotFake extends AppEngSlot
final int invSlot;
public SlotFake( IInventory inv, int idx, int x, int y )
public SlotFake( final IInventory inv, final int idx, final int x, final int y )
{
super( inv, idx, x, y );
this.invSlot = idx;
}
@Override
public void onPickupFromSlot( EntityPlayer par1EntityPlayer, ItemStack par2ItemStack )
public void onPickupFromSlot( final EntityPlayer par1EntityPlayer, final ItemStack par2ItemStack )
{
}
@Override
public ItemStack decrStackSize( int par1 )
public ItemStack decrStackSize( final int par1 )
{
return null;
}
@Override
public boolean isItemValid( ItemStack par1ItemStack )
public boolean isItemValid( final ItemStack par1ItemStack )
{
return false;
}
@@ -64,7 +64,7 @@ public class SlotFake extends AppEngSlot
}
@Override
public boolean canTakeStack( EntityPlayer par1EntityPlayer )
public boolean canTakeStack( final EntityPlayer par1EntityPlayer )
{
return false;
}
@@ -25,7 +25,7 @@ import net.minecraft.inventory.IInventory;
public class SlotFakeBlacklist extends SlotFakeTypeOnly
{
public SlotFakeBlacklist( IInventory inv, int idx, int x, int y )
public SlotFakeBlacklist( final IInventory inv, final int idx, final int x, final int y )
{
super( inv, idx, x, y );
}
@@ -25,7 +25,7 @@ import net.minecraft.inventory.IInventory;
public class SlotFakeCraftingMatrix extends SlotFake
{
public SlotFakeCraftingMatrix( IInventory inv, int idx, int x, int y )
public SlotFakeCraftingMatrix( final IInventory inv, final int idx, final int x, final int y )
{
super( inv, idx, x, y );
}
@@ -26,7 +26,7 @@ import net.minecraft.item.ItemStack;
public class SlotFakeTypeOnly extends SlotFake
{
public SlotFakeTypeOnly( IInventory inv, int idx, int x, int y )
public SlotFakeTypeOnly( final IInventory inv, final int idx, final int x, final int y )
{
super( inv, idx, x, y );
}
@@ -29,13 +29,13 @@ public class SlotInaccessible extends AppEngSlot
ItemStack dspStack = null;
public SlotInaccessible( IInventory i, int slotIdx, int x, int y )
public SlotInaccessible( final IInventory i, final int slotIdx, final int x, final int y )
{
super( i, slotIdx, x, y );
}
@Override
public boolean isItemValid( ItemStack i )
public boolean isItemValid( final ItemStack i )
{
return false;
}
@@ -48,7 +48,7 @@ public class SlotInaccessible extends AppEngSlot
}
@Override
public boolean canTakeStack( EntityPlayer par1EntityPlayer )
public boolean canTakeStack( final EntityPlayer par1EntityPlayer )
{
return false;
}
@@ -58,7 +58,7 @@ public class SlotInaccessible extends AppEngSlot
{
if( this.dspStack == null )
{
ItemStack dsp = super.getDisplayStack();
final ItemStack dsp = super.getDisplayStack();
if( dsp != null )
{
this.dspStack = dsp.copy();
@@ -25,7 +25,7 @@ import net.minecraft.inventory.IInventory;
public class SlotInaccessibleHD extends SlotInaccessible
{
public SlotInaccessibleHD( IInventory i, int slotIdx, int x, int y )
public SlotInaccessibleHD( final IInventory i, final int slotIdx, final int x, final int y )
{
super( i, slotIdx, x, y );
}
@@ -29,14 +29,14 @@ public class SlotMACPattern extends AppEngSlot
final ContainerMAC mac;
public SlotMACPattern( ContainerMAC mac, IInventory i, int slotIdx, int x, int y )
public SlotMACPattern( final ContainerMAC mac, final IInventory i, final int slotIdx, final int x, final int y )
{
super( i, slotIdx, x, y );
this.mac = mac;
}
@Override
public boolean isItemValid( ItemStack i )
public boolean isItemValid( final ItemStack i )
{
return this.mac.isValidItemForSlot( this.getSlotIndex(), i );
}
@@ -25,7 +25,7 @@ import net.minecraft.inventory.IInventory;
public class SlotNormal extends AppEngSlot
{
public SlotNormal( IInventory inv, int slot, int xPos, int yPos )
public SlotNormal( final IInventory inv, final int slot, final int xPos, final int yPos )
{
super( inv, slot, xPos, yPos );
}
@@ -26,14 +26,14 @@ import net.minecraft.item.ItemStack;
public class SlotOutput extends AppEngSlot
{
public SlotOutput( IInventory a, int b, int c, int d, int i )
public SlotOutput( final IInventory a, final int b, final int c, final int d, final int i )
{
super( a, b, c, d );
this.IIcon = i;
}
@Override
public boolean isItemValid( ItemStack i )
public boolean isItemValid( final ItemStack i )
{
return false;
}
@@ -25,7 +25,7 @@ import net.minecraft.inventory.IInventory;
public class SlotPatternOutputs extends OptionalSlotFake
{
public SlotPatternOutputs( IInventory inv, IOptionalSlotHost containerBus, int idx, int x, int y, int offX, int offY, int groupNum )
public SlotPatternOutputs( final IInventory inv, final IOptionalSlotHost containerBus, final int idx, final int x, final int y, final int offX, final int offY, final int groupNum )
{
super( inv, containerBus, idx, x, y, offX, offY, groupNum );
}
@@ -39,7 +39,7 @@ public class SlotPatternTerm extends SlotCraftingTerm
final int groupNum;
final IOptionalSlotHost host;
public SlotPatternTerm( EntityPlayer player, BaseActionSource mySrc, IEnergySource energySrc, IStorageMonitorable storage, IInventory cMatrix, IInventory secondMatrix, IInventory output, int x, int y, IOptionalSlotHost h, int groupNumber, IContainerCraftingPacket c )
public SlotPatternTerm( final EntityPlayer player, final BaseActionSource mySrc, final IEnergySource energySrc, final IStorageMonitorable storage, final IInventory cMatrix, final IInventory secondMatrix, final IInventory output, final int x, final int y, final IOptionalSlotHost h, final int groupNumber, final IContainerCraftingPacket c )
{
super( player, mySrc, energySrc, storage, cMatrix, secondMatrix, output, x, y, c );
@@ -47,7 +47,7 @@ public class SlotPatternTerm extends SlotCraftingTerm
this.groupNum = groupNumber;
}
public AppEngPacket getRequest( boolean shift ) throws IOException
public AppEngPacket getRequest( final boolean shift ) throws IOException
{
return new PacketPatternSlot( this.pattern, AEApi.instance().storage().createItemStack( this.getStack() ), shift );
}
@@ -25,7 +25,7 @@ import net.minecraft.inventory.IInventory;
public class SlotPlayerHotBar extends AppEngSlot
{
public SlotPlayerHotBar( IInventory par1iInventory, int par2, int par3, int par4 )
public SlotPlayerHotBar( final IInventory par1iInventory, final int par2, final int par3, final int par4 )
{
super( par1iInventory, par2, par3, par4 );
this.isPlayerSide = true;
@@ -27,7 +27,7 @@ import net.minecraft.inventory.IInventory;
public class SlotPlayerInv extends AppEngSlot
{
public SlotPlayerInv( IInventory par1iInventory, int par2, int par3, int par4 )
public SlotPlayerInv( final IInventory par1iInventory, final int par2, final int par3, final int par4 )
{
super( par1iInventory, par2, par3, par4 );
@@ -58,7 +58,7 @@ public class SlotRestrictedInput extends AppEngSlot
public boolean allowEdit = true;
public int stackLimit = -1;
public SlotRestrictedInput( PlacableItemType valid, IInventory i, int slotIndex, int x, int y, InventoryPlayer p )
public SlotRestrictedInput( final PlacableItemType valid, final IInventory i, final int slotIndex, final int x, final int y, final InventoryPlayer p )
{
super( i, slotIndex, x, y );
this.which = valid;
@@ -76,24 +76,24 @@ public class SlotRestrictedInput extends AppEngSlot
return super.getSlotStackLimit();
}
public boolean isValid( ItemStack is, World theWorld )
public boolean isValid( final ItemStack is, final World theWorld )
{
if( this.which == PlacableItemType.VALID_ENCODED_PATTERN_W_OUTPUT )
{
ICraftingPatternDetails ap = is.getItem() instanceof ICraftingPatternItem ? ( (ICraftingPatternItem) is.getItem() ).getPatternForItem( is, theWorld ) : null;
final ICraftingPatternDetails ap = is.getItem() instanceof ICraftingPatternItem ? ( (ICraftingPatternItem) is.getItem() ).getPatternForItem( is, theWorld ) : null;
return ap != null;
}
return true;
}
public Slot setStackLimit( int i )
public Slot setStackLimit( final int i )
{
this.stackLimit = i;
return this;
}
@Override
public boolean isItemValid( ItemStack i )
public boolean isItemValid( final ItemStack i )
{
if( !this.myContainer.isValidForSlot( this, i ) )
{
@@ -128,8 +128,8 @@ public class SlotRestrictedInput extends AppEngSlot
case ENCODED_CRAFTING_PATTERN:
if( i.getItem() instanceof ICraftingPatternItem )
{
ICraftingPatternItem b = (ICraftingPatternItem) i.getItem();
ICraftingPatternDetails de = b.getPatternForItem( i, this.p.player.worldObj );
final ICraftingPatternItem b = (ICraftingPatternItem) i.getItem();
final ICraftingPatternDetails de = b.getPatternForItem( i, this.p.player.worldObj );
if( de != null )
{
return de.isCraftable();
@@ -166,7 +166,7 @@ public class SlotRestrictedInput extends AppEngSlot
return true;
}
for( ItemStack optional : AEApi.instance().registries().inscriber().getOptionals() )
for( final ItemStack optional : AEApi.instance().registries().inscriber().getOptionals() )
{
if( Platform.isSameItemPrecise( optional, i ) )
{
@@ -230,7 +230,7 @@ public class SlotRestrictedInput extends AppEngSlot
}
@Override
public boolean canTakeStack( EntityPlayer par1EntityPlayer )
public boolean canTakeStack( final EntityPlayer par1EntityPlayer )
{
return this.allowEdit;
}
@@ -240,11 +240,11 @@ public class SlotRestrictedInput extends AppEngSlot
{
if( Platform.isClient() && ( this.which == PlacableItemType.ENCODED_PATTERN ) )
{
ItemStack is = super.getStack();
final ItemStack is = super.getStack();
if( is != null && is.getItem() instanceof ItemEncodedPattern )
{
ItemEncodedPattern iep = (ItemEncodedPattern) is.getItem();
ItemStack out = iep.getOutput( is );
final ItemEncodedPattern iep = (ItemEncodedPattern) is.getItem();
final ItemStack out = iep.getOutput( is );
if( out != null )
{
return out;
@@ -254,16 +254,16 @@ public class SlotRestrictedInput extends AppEngSlot
return super.getStack();
}
public static boolean isMetalIngot( ItemStack i )
public static boolean isMetalIngot( final ItemStack i )
{
if( Platform.isSameItemPrecise( i, new ItemStack( Items.iron_ingot ) ) )
{
return true;
}
for( String name : new String[] { "Copper", "Tin", "Obsidian", "Iron", "Lead", "Bronze", "Brass", "Nickel", "Aluminium" } )
for( final String name : new String[] { "Copper", "Tin", "Obsidian", "Iron", "Lead", "Bronze", "Brass", "Nickel", "Aluminium" } )
{
for( ItemStack ingot : OreDictionary.getOres( "ingot" + name ) )
for( final ItemStack ingot : OreDictionary.getOres( "ingot" + name ) )
{
if( Platform.isSameItemPrecise( i, ingot ) )
{
@@ -291,7 +291,7 @@ public class SlotRestrictedInput extends AppEngSlot
public final int IIcon;
PlacableItemType( int o )
PlacableItemType( final int o )
{
this.IIcon = o;
}