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
@@ -34,21 +34,21 @@ public class AdaptorIInventory extends InventoryAdaptor
private final IInventory i;
private final boolean wrapperEnabled;
public AdaptorIInventory( IInventory s )
public AdaptorIInventory( final IInventory s )
{
this.i = s;
this.wrapperEnabled = s instanceof IInventoryWrapper;
}
@Override
public ItemStack removeItems( int amount, ItemStack filter, IInventoryDestination destination )
public ItemStack removeItems( int amount, ItemStack filter, final IInventoryDestination destination )
{
int s = this.i.getSizeInventory();
final int s = this.i.getSizeInventory();
ItemStack rv = null;
for( int x = 0; x < s && amount > 0; x++ )
{
ItemStack is = this.i.getStackInSlot( x );
final ItemStack is = this.i.getStackInSlot( x );
if( is != null && this.canRemoveStackFromSlot( x, is ) && ( filter == null || Platform.isSameItemPrecise( is, filter ) ) )
{
int boundAmounts = amount;
@@ -83,7 +83,7 @@ public class AdaptorIInventory extends InventoryAdaptor
}
else
{
ItemStack po = is.copy();
final ItemStack po = is.copy();
po.stackSize -= boundAmounts;
this.i.setInventorySlotContents( x, po );
this.i.markDirty();
@@ -99,14 +99,14 @@ public class AdaptorIInventory extends InventoryAdaptor
}
@Override
public ItemStack simulateRemove( int amount, ItemStack filter, IInventoryDestination destination )
public ItemStack simulateRemove( int amount, final ItemStack filter, final IInventoryDestination destination )
{
int s = this.i.getSizeInventory();
final int s = this.i.getSizeInventory();
ItemStack rv = null;
for( int x = 0; x < s && amount > 0; x++ )
{
ItemStack is = this.i.getStackInSlot( x );
final ItemStack is = this.i.getStackInSlot( x );
if( is != null && this.canRemoveStackFromSlot( x, is ) && ( filter == null || Platform.isSameItemPrecise( is, filter ) ) )
{
int boundAmount = amount;
@@ -140,12 +140,12 @@ public class AdaptorIInventory extends InventoryAdaptor
}
@Override
public ItemStack removeSimilarItems( int amount, ItemStack filter, FuzzyMode fuzzyMode, IInventoryDestination destination )
public ItemStack removeSimilarItems( final int amount, final ItemStack filter, final FuzzyMode fuzzyMode, final IInventoryDestination destination )
{
int s = this.i.getSizeInventory();
final int s = this.i.getSizeInventory();
for( int x = 0; x < s; x++ )
{
ItemStack is = this.i.getStackInSlot( x );
final ItemStack is = this.i.getStackInSlot( x );
if( is != null && this.canRemoveStackFromSlot( x, is ) && ( filter == null || Platform.isSameItemFuzzy( is, filter, fuzzyMode ) ) )
{
int newAmount = amount;
@@ -171,7 +171,7 @@ public class AdaptorIInventory extends InventoryAdaptor
}
else
{
ItemStack po = is.copy();
final ItemStack po = is.copy();
po.stackSize -= rv.stackSize;
this.i.setInventorySlotContents( x, po );
this.i.markDirty();
@@ -189,12 +189,12 @@ public class AdaptorIInventory extends InventoryAdaptor
}
@Override
public ItemStack simulateSimilarRemove( int amount, ItemStack filter, FuzzyMode fuzzyMode, IInventoryDestination destination )
public ItemStack simulateSimilarRemove( final int amount, final ItemStack filter, final FuzzyMode fuzzyMode, final IInventoryDestination destination )
{
int s = this.i.getSizeInventory();
final int s = this.i.getSizeInventory();
for( int x = 0; x < s; x++ )
{
ItemStack is = this.i.getStackInSlot( x );
final ItemStack is = this.i.getStackInSlot( x );
if( is != null && this.canRemoveStackFromSlot( x, is ) && ( filter == null || Platform.isSameItemFuzzy( is, filter, fuzzyMode ) ) )
{
@@ -210,7 +210,7 @@ public class AdaptorIInventory extends InventoryAdaptor
if( boundAmount > 0 )
{
ItemStack rv = is.copy();
final ItemStack rv = is.copy();
rv.stackSize = boundAmount;
return rv;
}
@@ -220,13 +220,13 @@ public class AdaptorIInventory extends InventoryAdaptor
}
@Override
public ItemStack addItems( ItemStack toBeAdded )
public ItemStack addItems( final ItemStack toBeAdded )
{
return this.addItems( toBeAdded, true );
}
@Override
public ItemStack simulateAdd( ItemStack toBeSimulated )
public ItemStack simulateAdd( final ItemStack toBeSimulated )
{
return this.addItems( toBeSimulated, false );
}
@@ -234,7 +234,7 @@ public class AdaptorIInventory extends InventoryAdaptor
@Override
public boolean containsItems()
{
int s = this.i.getSizeInventory();
final int s = this.i.getSizeInventory();
for( int x = 0; x < s; x++ )
{
if( this.i.getStackInSlot( x ) != null )
@@ -257,26 +257,26 @@ public class AdaptorIInventory extends InventoryAdaptor
*
* @return the left itemstack, which could not be added
*/
private ItemStack addItems( ItemStack itemsToAdd, boolean modulate )
private ItemStack addItems( final ItemStack itemsToAdd, final boolean modulate )
{
if( itemsToAdd == null || itemsToAdd.stackSize == 0 )
{
return null;
}
ItemStack left = itemsToAdd.copy();
int stackLimit = itemsToAdd.getMaxStackSize();
int perOperationLimit = Math.min( this.i.getInventoryStackLimit(), stackLimit );
int inventorySize = this.i.getSizeInventory();
final ItemStack left = itemsToAdd.copy();
final int stackLimit = itemsToAdd.getMaxStackSize();
final int perOperationLimit = Math.min( this.i.getInventoryStackLimit(), stackLimit );
final int inventorySize = this.i.getSizeInventory();
for( int slot = 0; slot < inventorySize; slot++ )
{
ItemStack next = left.copy();
final ItemStack next = left.copy();
next.stackSize = Math.min( perOperationLimit, next.stackSize );
if( this.i.isItemValidForSlot( slot, next ) )
{
ItemStack is = this.i.getStackInSlot( slot );
final ItemStack is = this.i.getStackInSlot( slot );
if( is == null )
{
left.stackSize -= next.stackSize;
@@ -294,8 +294,8 @@ public class AdaptorIInventory extends InventoryAdaptor
}
else if( Platform.isSameItemPrecise( is, left ) && is.stackSize < perOperationLimit )
{
int room = perOperationLimit - is.stackSize;
int used = Math.min( left.stackSize, room );
final int room = perOperationLimit - is.stackSize;
final int used = Math.min( left.stackSize, room );
if( modulate )
{
@@ -316,7 +316,7 @@ public class AdaptorIInventory extends InventoryAdaptor
return left;
}
boolean canRemoveStackFromSlot( int x, ItemStack is )
boolean canRemoveStackFromSlot( final int x, final ItemStack is )
{
if( this.wrapperEnabled )
{
@@ -346,7 +346,7 @@ public class AdaptorIInventory extends InventoryAdaptor
@Override
public ItemSlot next()
{
ItemStack iss = AdaptorIInventory.this.i.getStackInSlot( this.x );
final ItemStack iss = AdaptorIInventory.this.i.getStackInSlot( this.x );
this.is.isExtractable = AdaptorIInventory.this.canRemoveStackFromSlot( this.x, iss );
this.is.setItemStack( iss );
+20 -20
View File
@@ -34,18 +34,18 @@ public class AdaptorList extends InventoryAdaptor
private final List<ItemStack> i;
public AdaptorList( List<ItemStack> s )
public AdaptorList( final List<ItemStack> s )
{
this.i = s;
}
@Override
public ItemStack removeItems( int amount, ItemStack filter, IInventoryDestination destination )
public ItemStack removeItems( int amount, final ItemStack filter, final IInventoryDestination destination )
{
int s = this.i.size();
final int s = this.i.size();
for( int x = 0; x < s; x++ )
{
ItemStack is = this.i.get( x );
final ItemStack is = this.i.get( x );
if( is != null && ( filter == null || Platform.isSameItemPrecise( is, filter ) ) )
{
if( amount > is.stackSize )
@@ -59,7 +59,7 @@ public class AdaptorList extends InventoryAdaptor
if( amount > 0 )
{
ItemStack rv = is.copy();
final ItemStack rv = is.copy();
rv.stackSize = amount;
is.stackSize -= amount;
@@ -77,9 +77,9 @@ public class AdaptorList extends InventoryAdaptor
}
@Override
public ItemStack simulateRemove( int amount, ItemStack filter, IInventoryDestination destination )
public ItemStack simulateRemove( int amount, final ItemStack filter, final IInventoryDestination destination )
{
for( ItemStack is : this.i )
for( final ItemStack is : this.i )
{
if( is != null && ( filter == null || Platform.isSameItemPrecise( is, filter ) ) )
{
@@ -94,7 +94,7 @@ public class AdaptorList extends InventoryAdaptor
if( amount > 0 )
{
ItemStack rv = is.copy();
final ItemStack rv = is.copy();
rv.stackSize = amount;
return rv;
}
@@ -104,12 +104,12 @@ public class AdaptorList extends InventoryAdaptor
}
@Override
public ItemStack removeSimilarItems( int amount, ItemStack filter, FuzzyMode fuzzyMode, IInventoryDestination destination )
public ItemStack removeSimilarItems( int amount, final ItemStack filter, final FuzzyMode fuzzyMode, final IInventoryDestination destination )
{
int s = this.i.size();
final int s = this.i.size();
for( int x = 0; x < s; x++ )
{
ItemStack is = this.i.get( x );
final ItemStack is = this.i.get( x );
if( is != null && ( filter == null || Platform.isSameItemFuzzy( is, filter, fuzzyMode ) ) )
{
if( amount > is.stackSize )
@@ -123,7 +123,7 @@ public class AdaptorList extends InventoryAdaptor
if( amount > 0 )
{
ItemStack rv = is.copy();
final ItemStack rv = is.copy();
rv.stackSize = amount;
is.stackSize -= amount;
@@ -141,9 +141,9 @@ public class AdaptorList extends InventoryAdaptor
}
@Override
public ItemStack simulateSimilarRemove( int amount, ItemStack filter, FuzzyMode fuzzyMode, IInventoryDestination destination )
public ItemStack simulateSimilarRemove( int amount, final ItemStack filter, final FuzzyMode fuzzyMode, final IInventoryDestination destination )
{
for( ItemStack is : this.i )
for( final ItemStack is : this.i )
{
if( is != null && ( filter == null || Platform.isSameItemFuzzy( is, filter, fuzzyMode ) ) )
{
@@ -158,7 +158,7 @@ public class AdaptorList extends InventoryAdaptor
if( amount > 0 )
{
ItemStack rv = is.copy();
final ItemStack rv = is.copy();
rv.stackSize = amount;
return rv;
}
@@ -168,7 +168,7 @@ public class AdaptorList extends InventoryAdaptor
}
@Override
public ItemStack addItems( ItemStack toBeAdded )
public ItemStack addItems( final ItemStack toBeAdded )
{
if( toBeAdded == null )
{
@@ -179,9 +179,9 @@ public class AdaptorList extends InventoryAdaptor
return null;
}
ItemStack left = toBeAdded.copy();
final ItemStack left = toBeAdded.copy();
for( ItemStack is : this.i )
for( final ItemStack is : this.i )
{
if( Platform.isSameItem( is, left ) )
{
@@ -195,7 +195,7 @@ public class AdaptorList extends InventoryAdaptor
}
@Override
public ItemStack simulateAdd( ItemStack toBeSimulated )
public ItemStack simulateAdd( final ItemStack toBeSimulated )
{
return null;
}
@@ -203,7 +203,7 @@ public class AdaptorList extends InventoryAdaptor
@Override
public boolean containsItems()
{
for( ItemStack is : this.i )
for( final ItemStack is : this.i )
{
if( is != null )
{
@@ -37,15 +37,15 @@ public class AdaptorPlayerHand extends InventoryAdaptor
private final EntityPlayer player;
public AdaptorPlayerHand( EntityPlayer player )
public AdaptorPlayerHand( final EntityPlayer player )
{
this.player = player;
}
@Override
public ItemStack removeItems( int amount, ItemStack filter, IInventoryDestination destination )
public ItemStack removeItems( final int amount, final ItemStack filter, final IInventoryDestination destination )
{
ItemStack hand = this.player.inventory.getItemStack();
final ItemStack hand = this.player.inventory.getItemStack();
if( hand == null )
{
return null;
@@ -53,7 +53,7 @@ public class AdaptorPlayerHand extends InventoryAdaptor
if( filter == null || Platform.isSameItemPrecise( filter, hand ) )
{
ItemStack result = hand.copy();
final ItemStack result = hand.copy();
result.stackSize = hand.stackSize > amount ? amount : hand.stackSize;
hand.stackSize -= amount;
if( hand.stackSize <= 0 )
@@ -67,10 +67,10 @@ public class AdaptorPlayerHand extends InventoryAdaptor
}
@Override
public ItemStack simulateRemove( int amount, ItemStack filter, IInventoryDestination destination )
public ItemStack simulateRemove( final int amount, final ItemStack filter, final IInventoryDestination destination )
{
ItemStack hand = this.player.inventory.getItemStack();
final ItemStack hand = this.player.inventory.getItemStack();
if( hand == null )
{
return null;
@@ -78,7 +78,7 @@ public class AdaptorPlayerHand extends InventoryAdaptor
if( filter == null || Platform.isSameItemPrecise( filter, hand ) )
{
ItemStack result = hand.copy();
final ItemStack result = hand.copy();
result.stackSize = hand.stackSize > amount ? amount : hand.stackSize;
return result;
}
@@ -87,9 +87,9 @@ public class AdaptorPlayerHand extends InventoryAdaptor
}
@Override
public ItemStack removeSimilarItems( int amount, ItemStack filter, FuzzyMode fuzzyMode, IInventoryDestination destination )
public ItemStack removeSimilarItems( final int amount, final ItemStack filter, final FuzzyMode fuzzyMode, final IInventoryDestination destination )
{
ItemStack hand = this.player.inventory.getItemStack();
final ItemStack hand = this.player.inventory.getItemStack();
if( hand == null )
{
return null;
@@ -97,7 +97,7 @@ public class AdaptorPlayerHand extends InventoryAdaptor
if( filter == null || Platform.isSameItemFuzzy( filter, hand, fuzzyMode ) )
{
ItemStack result = hand.copy();
final ItemStack result = hand.copy();
result.stackSize = hand.stackSize > amount ? amount : hand.stackSize;
hand.stackSize -= amount;
if( hand.stackSize <= 0 )
@@ -111,10 +111,10 @@ public class AdaptorPlayerHand extends InventoryAdaptor
}
@Override
public ItemStack simulateSimilarRemove( int amount, ItemStack filter, FuzzyMode fuzzyMode, IInventoryDestination destination )
public ItemStack simulateSimilarRemove( final int amount, final ItemStack filter, final FuzzyMode fuzzyMode, final IInventoryDestination destination )
{
ItemStack hand = this.player.inventory.getItemStack();
final ItemStack hand = this.player.inventory.getItemStack();
if( hand == null )
{
return null;
@@ -122,7 +122,7 @@ public class AdaptorPlayerHand extends InventoryAdaptor
if( filter == null || Platform.isSameItemFuzzy( filter, hand, fuzzyMode ) )
{
ItemStack result = hand.copy();
final ItemStack result = hand.copy();
result.stackSize = hand.stackSize > amount ? amount : hand.stackSize;
return result;
}
@@ -131,7 +131,7 @@ public class AdaptorPlayerHand extends InventoryAdaptor
}
@Override
public ItemStack addItems( ItemStack toBeAdded )
public ItemStack addItems( final ItemStack toBeAdded )
{
if( toBeAdded == null )
@@ -151,7 +151,7 @@ public class AdaptorPlayerHand extends InventoryAdaptor
return toBeAdded;
}
ItemStack hand = this.player.inventory.getItemStack();
final ItemStack hand = this.player.inventory.getItemStack();
if( hand != null && !Platform.isSameItemPrecise( toBeAdded, hand ) )
{
@@ -174,7 +174,7 @@ public class AdaptorPlayerHand extends InventoryAdaptor
if( newHand.stackSize > newHand.getMaxStackSize() )
{
newHand.stackSize = newHand.getMaxStackSize();
ItemStack B = toBeAdded.copy();
final ItemStack B = toBeAdded.copy();
B.stackSize -= newHand.stackSize - original;
this.player.inventory.setItemStack( newHand );
return B;
@@ -185,9 +185,9 @@ public class AdaptorPlayerHand extends InventoryAdaptor
}
@Override
public ItemStack simulateAdd( ItemStack toBeSimulated )
public ItemStack simulateAdd( final ItemStack toBeSimulated )
{
ItemStack hand = this.player.inventory.getItemStack();
final ItemStack hand = this.player.inventory.getItemStack();
if( toBeSimulated == null )
{
return null;
@@ -214,7 +214,7 @@ public class AdaptorPlayerHand extends InventoryAdaptor
if( newHand.stackSize > newHand.getMaxStackSize() )
{
newHand.stackSize = newHand.getMaxStackSize();
ItemStack B = toBeSimulated.copy();
final ItemStack B = toBeSimulated.copy();
B.stackSize -= newHand.stackSize - original;
return B;
}
@@ -32,7 +32,7 @@ public class AdaptorPlayerInventory implements IInventory
private final int min = 0;
private final int size = 36;
public AdaptorPlayerInventory( IInventory playerInv, boolean swap )
public AdaptorPlayerInventory( final IInventory playerInv, final boolean swap )
{
if( swap )
@@ -52,25 +52,25 @@ public class AdaptorPlayerInventory implements IInventory
}
@Override
public ItemStack getStackInSlot( int var1 )
public ItemStack getStackInSlot( final int var1 )
{
return this.src.getStackInSlot( var1 + this.min );
}
@Override
public ItemStack decrStackSize( int var1, int var2 )
public ItemStack decrStackSize( final int var1, final int var2 )
{
return this.src.decrStackSize( this.min + var1, var2 );
}
@Override
public ItemStack getStackInSlotOnClosing( int var1 )
public ItemStack getStackInSlotOnClosing( final int var1 )
{
return this.src.getStackInSlotOnClosing( this.min + var1 );
}
@Override
public void setInventorySlotContents( int var1, ItemStack var2 )
public void setInventorySlotContents( final int var1, final ItemStack var2 )
{
this.src.setInventorySlotContents( var1 + this.min, var2 );
}
@@ -100,27 +100,27 @@ public class AdaptorPlayerInventory implements IInventory
}
@Override
public boolean isUseableByPlayer( EntityPlayer var1 )
public boolean isUseableByPlayer( final EntityPlayer var1 )
{
return this.src.isUseableByPlayer( var1 );
}
@Override
public void openInventory(
EntityPlayer player )
final EntityPlayer player )
{
this.src.openInventory(player);
}
@Override
public void closeInventory(
EntityPlayer player )
final EntityPlayer player )
{
this.src.closeInventory(player);
}
@Override
public boolean isItemValidForSlot( int i, ItemStack itemstack )
public boolean isItemValidForSlot( final int i, final ItemStack itemstack )
{
return this.src.isItemValidForSlot( i, itemstack );
}
@@ -133,15 +133,15 @@ public class AdaptorPlayerInventory implements IInventory
@Override
public int getField(
int id )
final int id )
{
return src.getField( id );
}
@Override
public void setField(
int id,
int value )
final int id,
final int value )
{
src.setField( id, value );
}
+16 -16
View File
@@ -42,7 +42,7 @@ public class IMEAdaptor extends InventoryAdaptor
final BaseActionSource src;
int maxSlots = 0;
public IMEAdaptor( IMEInventory<IAEItemStack> input, BaseActionSource src )
public IMEAdaptor( final IMEInventory<IAEItemStack> input, final BaseActionSource src )
{
this.target = input;
this.src = src;
@@ -60,18 +60,18 @@ public class IMEAdaptor extends InventoryAdaptor
}
@Override
public ItemStack removeItems( int amount, ItemStack filter, IInventoryDestination destination )
public ItemStack removeItems( final int amount, final ItemStack filter, final IInventoryDestination destination )
{
return this.doRemoveItems( amount, filter, destination, Actionable.MODULATE );
}
public ItemStack doRemoveItems( int amount, ItemStack filter, IInventoryDestination destination, Actionable type )
public ItemStack doRemoveItems( final int amount, final ItemStack filter, final IInventoryDestination destination, final Actionable type )
{
IAEItemStack req = null;
if( filter == null )
{
IItemList<IAEItemStack> list = this.getList();
final IItemList<IAEItemStack> list = this.getList();
if( !list.isEmpty() )
{
req = list.getFirstItem();
@@ -99,13 +99,13 @@ public class IMEAdaptor extends InventoryAdaptor
}
@Override
public ItemStack simulateRemove( int amount, ItemStack filter, IInventoryDestination destination )
public ItemStack simulateRemove( final int amount, final ItemStack filter, final IInventoryDestination destination )
{
return this.doRemoveItems( amount, filter, destination, Actionable.SIMULATE );
}
@Override
public ItemStack removeSimilarItems( int amount, ItemStack filter, FuzzyMode fuzzyMode, IInventoryDestination destination )
public ItemStack removeSimilarItems( final int amount, final ItemStack filter, final FuzzyMode fuzzyMode, final IInventoryDestination destination )
{
if( filter == null )
{
@@ -114,9 +114,9 @@ public class IMEAdaptor extends InventoryAdaptor
return this.doRemoveItemsFuzzy( amount, filter, destination, Actionable.MODULATE, fuzzyMode );
}
public ItemStack doRemoveItemsFuzzy( int amount, ItemStack filter, IInventoryDestination destination, Actionable type, FuzzyMode fuzzyMode )
public ItemStack doRemoveItemsFuzzy( final int amount, final ItemStack filter, final IInventoryDestination destination, final Actionable type, final FuzzyMode fuzzyMode )
{
IAEItemStack reqFilter = AEItemStack.create( filter );
final IAEItemStack reqFilter = AEItemStack.create( filter );
if( reqFilter == null )
{
return null;
@@ -124,7 +124,7 @@ public class IMEAdaptor extends InventoryAdaptor
IAEItemStack out = null;
for( IAEItemStack req : ImmutableList.copyOf( this.getList().findFuzzy( reqFilter, fuzzyMode ) ) )
for( final IAEItemStack req : ImmutableList.copyOf( this.getList().findFuzzy( reqFilter, fuzzyMode ) ) )
{
if( req != null )
{
@@ -141,7 +141,7 @@ public class IMEAdaptor extends InventoryAdaptor
}
@Override
public ItemStack simulateSimilarRemove( int amount, ItemStack filter, FuzzyMode fuzzyMode, IInventoryDestination destination )
public ItemStack simulateSimilarRemove( final int amount, final ItemStack filter, final FuzzyMode fuzzyMode, final IInventoryDestination destination )
{
if( filter == null )
{
@@ -151,12 +151,12 @@ public class IMEAdaptor extends InventoryAdaptor
}
@Override
public ItemStack addItems( ItemStack toBeAdded )
public ItemStack addItems( final ItemStack toBeAdded )
{
IAEItemStack in = AEItemStack.create( toBeAdded );
final IAEItemStack in = AEItemStack.create( toBeAdded );
if( in != null )
{
IAEItemStack out = this.target.injectItems( in, Actionable.MODULATE, this.src );
final IAEItemStack out = this.target.injectItems( in, Actionable.MODULATE, this.src );
if( out != null )
{
return out.getItemStack();
@@ -166,12 +166,12 @@ public class IMEAdaptor extends InventoryAdaptor
}
@Override
public ItemStack simulateAdd( ItemStack toBeSimulated )
public ItemStack simulateAdd( final ItemStack toBeSimulated )
{
IAEItemStack in = AEItemStack.create( toBeSimulated );
final IAEItemStack in = AEItemStack.create( toBeSimulated );
if( in != null )
{
IAEItemStack out = this.target.injectItems( in, Actionable.SIMULATE, this.src );
final IAEItemStack out = this.target.injectItems( in, Actionable.SIMULATE, this.src );
if( out != null )
{
return out.getItemStack();
@@ -35,7 +35,7 @@ public final class IMEAdaptorIterator implements Iterator<ItemSlot>
private int offset = 0;
private boolean hasNext;
public IMEAdaptorIterator( IMEAdaptor parent, IItemList<IAEItemStack> availableItems )
public IMEAdaptorIterator( final IMEAdaptor parent, final IItemList<IAEItemStack> availableItems )
{
this.stack = availableItems.iterator();
this.containerSize = parent.maxSlots;
@@ -63,7 +63,7 @@ public final class IMEAdaptorIterator implements Iterator<ItemSlot>
if( this.hasNext )
{
IAEItemStack item = this.stack.next();
final IAEItemStack item = this.stack.next();
this.slot.setAEItemStack( item );
return this.slot;
}
@@ -31,13 +31,13 @@ public class IMEInventoryDestination implements IInventoryDestination
final IMEInventory<IAEItemStack> me;
public IMEInventoryDestination( IMEInventory<IAEItemStack> o )
public IMEInventoryDestination( final IMEInventory<IAEItemStack> o )
{
this.me = o;
}
@Override
public boolean canInsert( ItemStack stack )
public boolean canInsert( final ItemStack stack )
{
if( stack == null )
@@ -45,7 +45,7 @@ public class IMEInventoryDestination implements IInventoryDestination
return false;
}
IAEItemStack failed = this.me.injectItems( AEItemStack.create( stack ), Actionable.SIMULATE, null );
final IAEItemStack failed = this.me.injectItems( AEItemStack.create( stack ), Actionable.SIMULATE, null );
if( failed == null )
{
@@ -32,7 +32,7 @@ public class ItemListIgnoreCrafting<T extends IAEStack> implements IItemList<T>
final IItemList<T> target;
public ItemListIgnoreCrafting( IItemList<T> cla )
public ItemListIgnoreCrafting( final IItemList<T> cla )
{
this.target = cla;
}
@@ -50,13 +50,13 @@ public class ItemListIgnoreCrafting<T extends IAEStack> implements IItemList<T>
}
@Override
public T findPrecise( T i )
public T findPrecise( final T i )
{
return this.target.findPrecise( i );
}
@Override
public Collection<T> findFuzzy( T input, FuzzyMode fuzzy )
public Collection<T> findFuzzy( final T input, final FuzzyMode fuzzy )
{
return this.target.findFuzzy( input, fuzzy );
}
@@ -68,19 +68,19 @@ public class ItemListIgnoreCrafting<T extends IAEStack> implements IItemList<T>
}
@Override
public void addStorage( T option )
public void addStorage( final T option )
{
this.target.addStorage( option );
}
@Override
public void addCrafting( T option )
public void addCrafting( final T option )
{
// nothing.
}
@Override
public void addRequestable( T option )
public void addRequestable( final T option )
{
this.target.addRequestable( option );
}
+2 -2
View File
@@ -38,7 +38,7 @@ public class ItemSlot
return this.itemStack == null ? ( this.aeItemStack == null ? null : ( this.itemStack = this.aeItemStack.getItemStack() ) ) : this.itemStack;
}
public void setItemStack( ItemStack is )
public void setItemStack( final ItemStack is )
{
this.aeItemStack = null;
this.itemStack = is;
@@ -49,7 +49,7 @@ public class ItemSlot
return this.aeItemStack == null ? ( this.itemStack == null ? null : ( this.aeItemStack = AEItemStack.create( this.itemStack ) ) ) : this.aeItemStack;
}
public void setAEItemStack( IAEItemStack is )
public void setAEItemStack( final IAEItemStack is )
{
this.aeItemStack = is;
this.itemStack = null;
@@ -37,7 +37,7 @@ public class WrapperBCPipe implements IInventory
private final TileEntity ad;
private final EnumFacing dir;
public WrapperBCPipe( TileEntity te, EnumFacing d )
public WrapperBCPipe( final TileEntity te, final EnumFacing d )
{
this.bc = (IBuildCraftTransport) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.BuildCraftTransport );
this.ad = te;
@@ -51,25 +51,25 @@ public class WrapperBCPipe implements IInventory
}
@Override
public ItemStack getStackInSlot( int i )
public ItemStack getStackInSlot( final int i )
{
return null;
}
@Override
public ItemStack decrStackSize( int i, int j )
public ItemStack decrStackSize( final int i, final int j )
{
return null;
}
@Override
public ItemStack getStackInSlotOnClosing( int i )
public ItemStack getStackInSlotOnClosing( final int i )
{
return null;
}
@Override
public void setInventorySlotContents( int i, ItemStack itemstack )
public void setInventorySlotContents( final int i, final ItemStack itemstack )
{
if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.BuildCraftTransport ) )
{
@@ -90,37 +90,37 @@ public class WrapperBCPipe implements IInventory
}
@Override
public void openInventory( EntityPlayer player )
public void openInventory( final EntityPlayer player )
{
}
@Override
public void closeInventory( EntityPlayer player )
public void closeInventory( final EntityPlayer player )
{
}
@Override
public boolean isUseableByPlayer( EntityPlayer entityplayer )
public boolean isUseableByPlayer( final EntityPlayer entityplayer )
{
return false;
}
@Override
public boolean isItemValidForSlot( int i, ItemStack itemstack )
public boolean isItemValidForSlot( final int i, final ItemStack itemstack )
{
return this.bc.canAddItemsToPipe( this.ad, itemstack, this.dir );
}
@Override
public int getField( int id )
public int getField( final int id )
{
return 0;
}
@Override
public void setField( int id, int value )
public void setField( final int id, final int value )
{
}
@@ -39,12 +39,12 @@ public class WrapperChainedInventory implements IInventory
private List<IInventory> l;
private Map<Integer, InvOffset> offsets;
public WrapperChainedInventory( IInventory... inventories )
public WrapperChainedInventory( final IInventory... inventories )
{
this.setInventory( inventories );
}
public void setInventory( IInventory... a )
public void setInventory( final IInventory... a )
{
this.l = ImmutableList.copyOf( a );
this.calculateSizes();
@@ -55,9 +55,9 @@ public class WrapperChainedInventory implements IInventory
this.offsets = new HashMap<Integer, WrapperChainedInventory.InvOffset>();
int offset = 0;
for( IInventory in : this.l )
for( final IInventory in : this.l )
{
InvOffset io = new InvOffset();
final InvOffset io = new InvOffset();
io.offset = offset;
io.size = in.getSizeInventory();
io.i = in;
@@ -73,12 +73,12 @@ public class WrapperChainedInventory implements IInventory
this.fullSize = offset;
}
public WrapperChainedInventory( List<IInventory> inventories )
public WrapperChainedInventory( final List<IInventory> inventories )
{
this.setInventory( inventories );
}
public void setInventory( List<IInventory> a )
public void setInventory( final List<IInventory> a )
{
this.l = a;
this.calculateSizes();
@@ -88,7 +88,7 @@ public class WrapperChainedInventory implements IInventory
{
if( this.l.size() > 1 )
{
List<IInventory> newOrder = new ArrayList<IInventory>( this.l.size() );
final List<IInventory> newOrder = new ArrayList<IInventory>( this.l.size() );
newOrder.add( this.l.get( this.l.size() - 1 ) );
for( int x = 0; x < this.l.size() - 1; x++ )
{
@@ -98,9 +98,9 @@ public class WrapperChainedInventory implements IInventory
}
}
public IInventory getInv( int idx )
public IInventory getInv( final int idx )
{
InvOffset io = this.offsets.get( idx );
final InvOffset io = this.offsets.get( idx );
if( io != null )
{
return io.i;
@@ -108,9 +108,9 @@ public class WrapperChainedInventory implements IInventory
return null;
}
public int getInvSlot( int idx )
public int getInvSlot( final int idx )
{
InvOffset io = this.offsets.get( idx );
final InvOffset io = this.offsets.get( idx );
if( io != null )
{
return idx - io.offset;
@@ -125,9 +125,9 @@ public class WrapperChainedInventory implements IInventory
}
@Override
public ItemStack getStackInSlot( int idx )
public ItemStack getStackInSlot( final int idx )
{
InvOffset io = this.offsets.get( idx );
final InvOffset io = this.offsets.get( idx );
if( io != null )
{
return io.i.getStackInSlot( idx - io.offset );
@@ -136,9 +136,9 @@ public class WrapperChainedInventory implements IInventory
}
@Override
public ItemStack decrStackSize( int idx, int var2 )
public ItemStack decrStackSize( final int idx, final int var2 )
{
InvOffset io = this.offsets.get( idx );
final InvOffset io = this.offsets.get( idx );
if( io != null )
{
return io.i.decrStackSize( idx - io.offset, var2 );
@@ -147,9 +147,9 @@ public class WrapperChainedInventory implements IInventory
}
@Override
public ItemStack getStackInSlotOnClosing( int idx )
public ItemStack getStackInSlotOnClosing( final int idx )
{
InvOffset io = this.offsets.get( idx );
final InvOffset io = this.offsets.get( idx );
if( io != null )
{
return io.i.getStackInSlotOnClosing( idx - io.offset );
@@ -158,9 +158,9 @@ public class WrapperChainedInventory implements IInventory
}
@Override
public void setInventorySlotContents( int idx, ItemStack var2 )
public void setInventorySlotContents( final int idx, final ItemStack var2 )
{
InvOffset io = this.offsets.get( idx );
final InvOffset io = this.offsets.get( idx );
if( io != null )
{
io.i.setInventorySlotContents( idx - io.offset, var2 );
@@ -184,7 +184,7 @@ public class WrapperChainedInventory implements IInventory
{
int smallest = 64;
for( IInventory i : this.l )
for( final IInventory i : this.l )
{
smallest = Math.min( smallest, i.getInventoryStackLimit() );
}
@@ -195,34 +195,34 @@ public class WrapperChainedInventory implements IInventory
@Override
public void markDirty()
{
for( IInventory i : this.l )
for( final IInventory i : this.l )
{
i.markDirty();
}
}
@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 idx, ItemStack itemstack )
public boolean isItemValidForSlot( final int idx, final ItemStack itemstack )
{
InvOffset io = this.offsets.get( idx );
final InvOffset io = this.offsets.get( idx );
if( io != null )
{
return io.i.isItemValidForSlot( idx - io.offset, itemstack );
@@ -246,15 +246,15 @@ public class WrapperChainedInventory implements IInventory
@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,17 +30,17 @@ public class WrapperInvSlot
private final IInventory inv;
public WrapperInvSlot( IInventory inv )
public WrapperInvSlot( final IInventory inv )
{
this.inv = inv;
}
public IInventory getWrapper( int slot )
public IInventory getWrapper( final int slot )
{
return new InternalInterfaceWrapper( this.inv, slot );
}
protected boolean isItemValid( ItemStack itemstack )
protected boolean isItemValid( final ItemStack itemstack )
{
return true;
}
@@ -51,7 +51,7 @@ public class WrapperInvSlot
private final IInventory inv;
private final int slot;
public InternalInterfaceWrapper( IInventory target, int slot )
public InternalInterfaceWrapper( final IInventory target, final int slot )
{
this.inv = target;
this.slot = slot;
@@ -64,25 +64,25 @@ public class WrapperInvSlot
}
@Override
public ItemStack getStackInSlot( int i )
public ItemStack getStackInSlot( final int i )
{
return this.inv.getStackInSlot( this.slot );
}
@Override
public ItemStack decrStackSize( int i, int num )
public ItemStack decrStackSize( final int i, final int num )
{
return this.inv.decrStackSize( this.slot, num );
}
@Override
public ItemStack getStackInSlotOnClosing( int i )
public ItemStack getStackInSlotOnClosing( final int i )
{
return this.inv.getStackInSlotOnClosing( this.slot );
}
@Override
public void setInventorySlotContents( int i, ItemStack itemstack )
public void setInventorySlotContents( final int i, final ItemStack itemstack )
{
this.inv.setInventorySlotContents( this.slot, itemstack );
}
@@ -100,7 +100,7 @@ public class WrapperInvSlot
}
@Override
public boolean isUseableByPlayer( EntityPlayer entityplayer )
public boolean isUseableByPlayer( final EntityPlayer entityplayer )
{
return this.inv.isUseableByPlayer( entityplayer );
}
@@ -119,14 +119,14 @@ public class WrapperInvSlot
@Override
public void openInventory(
EntityPlayer player )
final EntityPlayer player )
{
this.inv.openInventory(player);
}
@Override
public void closeInventory(
EntityPlayer player )
final EntityPlayer player )
{
this.inv.closeInventory(player);
}
@@ -139,7 +139,7 @@ public class WrapperInvSlot
@Override
public int getField(
int id )
final int id )
{
return inv.getField( id );
}
@@ -151,7 +151,7 @@ public class WrapperInvSlot
}
@Override
public boolean isItemValidForSlot( int i, ItemStack itemstack )
public boolean isItemValidForSlot( final int i, final ItemStack itemstack )
{
return WrapperInvSlot.this.isItemValid( itemstack ) && this.inv.isItemValidForSlot( this.slot, itemstack );
}
@@ -164,8 +164,8 @@ public class WrapperInvSlot
@Override
public void setField(
int id,
int value )
final int id,
final int value )
{
inv.setField( id, value );
}
@@ -32,7 +32,7 @@ public class WrapperInventoryRange implements IInventory
protected boolean ignoreValidItems = false;
int[] slots;
public WrapperInventoryRange( IInventory a, int[] s, boolean ignoreValid )
public WrapperInventoryRange( final IInventory a, final int[] s, final boolean ignoreValid )
{
this.src = a;
this.slots = s;
@@ -45,7 +45,7 @@ public class WrapperInventoryRange implements IInventory
this.ignoreValidItems = ignoreValid;
}
public WrapperInventoryRange( IInventory a, int min, int size, boolean ignoreValid )
public WrapperInventoryRange( final IInventory a, final int min, final int size, final boolean ignoreValid )
{
this.src = a;
this.slots = new int[size];
@@ -56,12 +56,12 @@ public class WrapperInventoryRange implements IInventory
this.ignoreValidItems = ignoreValid;
}
public static String concatLines( int[] s, String separator )
public static String concatLines( final int[] s, final String separator )
{
if( s.length > 0 )
{
StringBuilder sb = new StringBuilder();
for( int value : s )
final StringBuilder sb = new StringBuilder();
for( final int value : s )
{
if( sb.length() > 0 )
{
@@ -81,25 +81,25 @@ public class WrapperInventoryRange implements IInventory
}
@Override
public ItemStack getStackInSlot( int var1 )
public ItemStack getStackInSlot( final int var1 )
{
return this.src.getStackInSlot( this.slots[var1] );
}
@Override
public ItemStack decrStackSize( int var1, int var2 )
public ItemStack decrStackSize( final int var1, final int var2 )
{
return this.src.decrStackSize( this.slots[var1], var2 );
}
@Override
public ItemStack getStackInSlotOnClosing( int var1 )
public ItemStack getStackInSlotOnClosing( final int var1 )
{
return this.src.getStackInSlotOnClosing( this.slots[var1] );
}
@Override
public void setInventorySlotContents( int var1, ItemStack var2 )
public void setInventorySlotContents( final int var1, final ItemStack var2 )
{
this.src.setInventorySlotContents( this.slots[var1], var2 );
}
@@ -117,7 +117,7 @@ public class WrapperInventoryRange implements IInventory
}
@Override
public boolean isUseableByPlayer( EntityPlayer var1 )
public boolean isUseableByPlayer( final EntityPlayer var1 )
{
return this.src.isUseableByPlayer( var1 );
}
@@ -136,14 +136,14 @@ public class WrapperInventoryRange implements IInventory
@Override
public void openInventory(
EntityPlayer player )
final EntityPlayer player )
{
this.src.openInventory(player);
}
@Override
public void closeInventory(
EntityPlayer player )
final EntityPlayer player )
{
this.src.closeInventory(player);
}
@@ -156,7 +156,7 @@ public class WrapperInventoryRange implements IInventory
@Override
public int getField(
int id )
final int id )
{
return src.getField( id );
}
@@ -175,13 +175,13 @@ public class WrapperInventoryRange implements IInventory
@Override
public void setField(
int id,
int value )
final int id,
final int value )
{
src.setField( id, value );
}
@Override
public boolean isItemValidForSlot( int i, ItemStack itemstack )
public boolean isItemValidForSlot( final int i, final ItemStack itemstack )
{
if( this.ignoreValidItems )
{
@@ -30,7 +30,7 @@ public class WrapperMCISidedInventory extends WrapperInventoryRange implements I
final ISidedInventory side;
private final EnumFacing dir;
public WrapperMCISidedInventory( ISidedInventory a, EnumFacing d )
public WrapperMCISidedInventory( final ISidedInventory a, final EnumFacing d )
{
super( a, a.getSlotsForFace( d ), false );
this.side = a;
@@ -38,7 +38,7 @@ public class WrapperMCISidedInventory extends WrapperInventoryRange implements I
}
@Override
public ItemStack decrStackSize( int var1, int var2 )
public ItemStack decrStackSize( final int var1, final int var2 )
{
if( this.canRemoveItemFromSlot( var1, this.getStackInSlot( var1 ) ) )
{
@@ -48,7 +48,7 @@ public class WrapperMCISidedInventory extends WrapperInventoryRange implements I
}
@Override
public boolean isItemValidForSlot( int i, ItemStack itemstack )
public boolean isItemValidForSlot( final int i, final ItemStack itemstack )
{
if( this.ignoreValidItems )
@@ -65,7 +65,7 @@ public class WrapperMCISidedInventory extends WrapperInventoryRange implements I
}
@Override
public boolean canRemoveItemFromSlot( int i, ItemStack is )
public boolean canRemoveItemFromSlot( final int i, final ItemStack is )
{
if( is == null )
{