final variables and parameters
This commit is contained in:
@@ -27,13 +27,13 @@ public class BlockUpdate implements IWorldCallable<Boolean>
|
||||
{
|
||||
final BlockPos pos;
|
||||
|
||||
public BlockUpdate( BlockPos pos )
|
||||
public BlockUpdate( final BlockPos pos )
|
||||
{
|
||||
this.pos=pos;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean call( World world ) throws Exception
|
||||
public Boolean call( final World world ) throws Exception
|
||||
{
|
||||
if ( world.isBlockLoaded( this.pos ) )
|
||||
{
|
||||
|
||||
@@ -32,7 +32,7 @@ public class ClassInstantiation<T>
|
||||
private final Class<? extends T> template;
|
||||
private final Object[] args;
|
||||
|
||||
public ClassInstantiation( Class<? extends T> template, Object... args )
|
||||
public ClassInstantiation( final Class<? extends T> template, final Object... args )
|
||||
{
|
||||
this.template = template;
|
||||
this.args = args;
|
||||
@@ -41,18 +41,18 @@ public class ClassInstantiation<T>
|
||||
public Optional<T> get()
|
||||
{
|
||||
@SuppressWarnings( "unchecked" )
|
||||
Constructor<T>[] constructors = (Constructor<T>[]) this.template.getConstructors();
|
||||
final Constructor<T>[] constructors = (Constructor<T>[]) this.template.getConstructors();
|
||||
|
||||
for( Constructor<T> constructor : constructors )
|
||||
for( final Constructor<T> constructor : constructors )
|
||||
{
|
||||
Class<?>[] paramTypes = constructor.getParameterTypes();
|
||||
final Class<?>[] paramTypes = constructor.getParameterTypes();
|
||||
if( paramTypes.length == this.args.length )
|
||||
{
|
||||
boolean valid = true;
|
||||
|
||||
for( int idx = 0; idx < paramTypes.length; idx++ )
|
||||
{
|
||||
Class<?> cz = this.args[idx].getClass();
|
||||
final Class<?> cz = this.args[idx].getClass();
|
||||
if( !this.isClassMatch( paramTypes[idx], cz, this.args[idx] ) )
|
||||
{
|
||||
valid = false;
|
||||
@@ -65,15 +65,15 @@ public class ClassInstantiation<T>
|
||||
{
|
||||
return Optional.of( constructor.newInstance( this.args ) );
|
||||
}
|
||||
catch( InstantiationException e )
|
||||
catch( final InstantiationException e )
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
catch( IllegalAccessException e )
|
||||
catch( final IllegalAccessException e )
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
catch( InvocationTargetException e )
|
||||
catch( final InvocationTargetException e )
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
@@ -85,7 +85,7 @@ public class ClassInstantiation<T>
|
||||
return Optional.absent();
|
||||
}
|
||||
|
||||
private boolean isClassMatch( Class<?> expected, Class<?> got, Object value )
|
||||
private boolean isClassMatch( Class<?> expected, Class<?> got, final Object value )
|
||||
{
|
||||
if( value == null && !expected.isPrimitive() )
|
||||
{
|
||||
@@ -98,11 +98,11 @@ public class ClassInstantiation<T>
|
||||
return expected == got || expected.isAssignableFrom( got );
|
||||
}
|
||||
|
||||
private Class<?> condense( Class<?> expected, Class<?>... wrappers )
|
||||
private Class<?> condense( final Class<?> expected, final Class<?>... wrappers )
|
||||
{
|
||||
if( expected.isPrimitive() )
|
||||
{
|
||||
for( Class clz : wrappers )
|
||||
for( final Class clz : wrappers )
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -111,7 +111,7 @@ public class ClassInstantiation<T>
|
||||
return clz;
|
||||
}
|
||||
}
|
||||
catch( Throwable t )
|
||||
catch( final Throwable t )
|
||||
{
|
||||
AELog.error( t );
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ public final class ConfigManager implements IConfigManager
|
||||
private final Map<Settings, Enum<?>> settings = new EnumMap<Settings, Enum<?>>( Settings.class );
|
||||
private final IConfigManagerHost target;
|
||||
|
||||
public ConfigManager( IConfigManagerHost tile )
|
||||
public ConfigManager( final IConfigManagerHost tile )
|
||||
{
|
||||
this.target = tile;
|
||||
}
|
||||
@@ -48,15 +48,15 @@ public final class ConfigManager implements IConfigManager
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerSetting( Settings settingName, Enum defaultValue )
|
||||
public void registerSetting( final Settings settingName, final Enum defaultValue )
|
||||
{
|
||||
this.settings.put( settingName, defaultValue );
|
||||
}
|
||||
|
||||
@Override
|
||||
public Enum<?> getSetting( Settings settingName )
|
||||
public Enum<?> getSetting( final Settings settingName )
|
||||
{
|
||||
Enum<?> oldValue = this.settings.get( settingName );
|
||||
final Enum<?> oldValue = this.settings.get( settingName );
|
||||
|
||||
if( oldValue != null )
|
||||
{
|
||||
@@ -67,9 +67,9 @@ public final class ConfigManager implements IConfigManager
|
||||
}
|
||||
|
||||
@Override
|
||||
public Enum<?> putSetting( Settings settingName, Enum newValue )
|
||||
public Enum<?> putSetting( final Settings settingName, final Enum newValue )
|
||||
{
|
||||
Enum<?> oldValue = this.getSetting( settingName );
|
||||
final Enum<?> oldValue = this.getSetting( settingName );
|
||||
this.settings.put( settingName, newValue );
|
||||
this.target.updateSetting( this, settingName, newValue );
|
||||
return oldValue;
|
||||
@@ -81,9 +81,9 @@ public final class ConfigManager implements IConfigManager
|
||||
* @param tagCompound to be written to compound
|
||||
*/
|
||||
@Override
|
||||
public void writeToNBT( NBTTagCompound tagCompound )
|
||||
public void writeToNBT( final NBTTagCompound tagCompound )
|
||||
{
|
||||
for( Map.Entry<Settings, Enum<?>> entry : this.settings.entrySet() )
|
||||
for( final Map.Entry<Settings, Enum<?>> entry : this.settings.entrySet() )
|
||||
{
|
||||
tagCompound.setString( entry.getKey().name(), this.settings.get( entry.getKey() ).toString() );
|
||||
}
|
||||
@@ -95,9 +95,9 @@ public final class ConfigManager implements IConfigManager
|
||||
* @param tagCompound to be read from compound
|
||||
*/
|
||||
@Override
|
||||
public void readFromNBT( NBTTagCompound tagCompound )
|
||||
public void readFromNBT( final NBTTagCompound tagCompound )
|
||||
{
|
||||
for( Map.Entry<Settings, Enum<?>> entry : this.settings.entrySet() )
|
||||
for( final Map.Entry<Settings, Enum<?>> entry : this.settings.entrySet() )
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -115,14 +115,14 @@ public final class ConfigManager implements IConfigManager
|
||||
value = LevelEmitterMode.STORABLE_AMOUNT.toString();
|
||||
}
|
||||
|
||||
Enum<?> oldValue = this.settings.get( entry.getKey() );
|
||||
final Enum<?> oldValue = this.settings.get( entry.getKey() );
|
||||
|
||||
Enum<?> newValue = Enum.valueOf( oldValue.getClass(), value );
|
||||
final Enum<?> newValue = Enum.valueOf( oldValue.getClass(), value );
|
||||
|
||||
this.putSetting( entry.getKey(), newValue );
|
||||
}
|
||||
}
|
||||
catch( IllegalArgumentException e )
|
||||
catch( final IllegalArgumentException e )
|
||||
{
|
||||
AELog.error( e );
|
||||
}
|
||||
|
||||
@@ -39,28 +39,28 @@ public class InWorldToolOperationResult
|
||||
this.Drops = null;
|
||||
}
|
||||
|
||||
public InWorldToolOperationResult( ItemStack block, List<ItemStack> drops )
|
||||
public InWorldToolOperationResult( final ItemStack block, final List<ItemStack> drops )
|
||||
{
|
||||
this.BlockItem = block;
|
||||
this.Drops = drops;
|
||||
}
|
||||
|
||||
public InWorldToolOperationResult( ItemStack block )
|
||||
public InWorldToolOperationResult( final ItemStack block )
|
||||
{
|
||||
this.BlockItem = block;
|
||||
this.Drops = null;
|
||||
}
|
||||
|
||||
public static InWorldToolOperationResult getBlockOperationResult( ItemStack[] items )
|
||||
public static InWorldToolOperationResult getBlockOperationResult( final ItemStack[] items )
|
||||
{
|
||||
List<ItemStack> temp = new ArrayList<ItemStack>();
|
||||
final List<ItemStack> temp = new ArrayList<ItemStack>();
|
||||
ItemStack b = null;
|
||||
|
||||
for( ItemStack l : items )
|
||||
for( final ItemStack l : items )
|
||||
{
|
||||
if( b == null )
|
||||
{
|
||||
Block bl = Block.getBlockFromItem( l.getItem() );
|
||||
final Block bl = Block.getBlockFromItem( l.getItem() );
|
||||
|
||||
if( bl != null && !( bl instanceof BlockAir ) )
|
||||
{
|
||||
|
||||
@@ -43,14 +43,14 @@ public abstract class InventoryAdaptor implements Iterable<ItemSlot>
|
||||
{
|
||||
|
||||
// returns an appropriate adaptor, or null
|
||||
public static InventoryAdaptor getAdaptor( Object te, EnumFacing d )
|
||||
public static InventoryAdaptor getAdaptor( final Object te, final EnumFacing d )
|
||||
{
|
||||
if( te == null )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
IBetterStorage bs = (IBetterStorage) ( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.BetterStorage ) ? IntegrationRegistry.INSTANCE.getInstance( IntegrationType.BetterStorage ) : null );
|
||||
final IBetterStorage bs = (IBetterStorage) ( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.BetterStorage ) ? IntegrationRegistry.INSTANCE.getInstance( IntegrationType.BetterStorage ) : null );
|
||||
|
||||
if( te instanceof EntityPlayer )
|
||||
{
|
||||
@@ -73,8 +73,8 @@ public abstract class InventoryAdaptor implements Iterable<ItemSlot>
|
||||
}
|
||||
else if( te instanceof ISidedInventory )
|
||||
{
|
||||
ISidedInventory si = (ISidedInventory) te;
|
||||
int[] slots = si.getSlotsForFace( d );
|
||||
final ISidedInventory si = (ISidedInventory) te;
|
||||
final int[] slots = si.getSlotsForFace( d );
|
||||
if( si.getSizeInventory() > 0 && slots != null && slots.length > 0 )
|
||||
{
|
||||
return new AdaptorIInventory( new WrapperMCISidedInventory( si, d ) );
|
||||
@@ -82,7 +82,7 @@ public abstract class InventoryAdaptor implements Iterable<ItemSlot>
|
||||
}
|
||||
else if( te instanceof IInventory )
|
||||
{
|
||||
IInventory i = (IInventory) te;
|
||||
final IInventory i = (IInventory) te;
|
||||
if( i.getSizeInventory() > 0 )
|
||||
{
|
||||
return new AdaptorIInventory( i );
|
||||
|
||||
@@ -37,7 +37,7 @@ public class ItemSorters
|
||||
{
|
||||
|
||||
@Override
|
||||
public int compare( IAEItemStack o1, IAEItemStack o2 )
|
||||
public int compare( final IAEItemStack o1, final IAEItemStack o2 )
|
||||
{
|
||||
if( Direction == SortDir.ASCENDING )
|
||||
{
|
||||
@@ -50,10 +50,10 @@ public class ItemSorters
|
||||
{
|
||||
|
||||
@Override
|
||||
public int compare( IAEItemStack o1, IAEItemStack o2 )
|
||||
public int compare( final IAEItemStack o1, final IAEItemStack o2 )
|
||||
{
|
||||
AEItemStack op1 = (AEItemStack) o1;
|
||||
AEItemStack op2 = (AEItemStack) o2;
|
||||
final AEItemStack op1 = (AEItemStack) o1;
|
||||
final AEItemStack op2 = (AEItemStack) o2;
|
||||
|
||||
if( Direction == SortDir.ASCENDING )
|
||||
{
|
||||
@@ -62,7 +62,7 @@ public class ItemSorters
|
||||
return this.secondarySort( op1.getModID().compareToIgnoreCase( op2.getModID() ), o2, o1 );
|
||||
}
|
||||
|
||||
private int secondarySort( int compareToIgnoreCase, IAEItemStack o1, IAEItemStack o2 )
|
||||
private int secondarySort( final int compareToIgnoreCase, final IAEItemStack o1, final IAEItemStack o2 )
|
||||
{
|
||||
if( compareToIgnoreCase == 0 )
|
||||
{
|
||||
@@ -76,7 +76,7 @@ public class ItemSorters
|
||||
{
|
||||
|
||||
@Override
|
||||
public int compare( IAEItemStack o1, IAEItemStack o2 )
|
||||
public int compare( final IAEItemStack o1, final IAEItemStack o2 )
|
||||
{
|
||||
if( Direction == SortDir.ASCENDING )
|
||||
{
|
||||
@@ -90,14 +90,14 @@ public class ItemSorters
|
||||
{
|
||||
|
||||
@Override
|
||||
public int compare( IAEItemStack o1, IAEItemStack o2 )
|
||||
public int compare( final IAEItemStack o1, final IAEItemStack o2 )
|
||||
{
|
||||
if( api == null )
|
||||
{
|
||||
return CONFIG_BASED_SORT_BY_NAME.compare( o1, o2 );
|
||||
}
|
||||
|
||||
int cmp = api.compareItems( o1.getItemStack(), o2.getItemStack() );
|
||||
final int cmp = api.compareItems( o1.getItemStack(), o2.getItemStack() );
|
||||
|
||||
if( Direction == SortDir.ASCENDING )
|
||||
{
|
||||
@@ -124,7 +124,7 @@ public class ItemSorters
|
||||
}
|
||||
}
|
||||
|
||||
public static int compareInt( int a, int b )
|
||||
public static int compareInt( final int a, final int b )
|
||||
{
|
||||
if( a == b )
|
||||
{
|
||||
@@ -137,7 +137,7 @@ public class ItemSorters
|
||||
return 1;
|
||||
}
|
||||
|
||||
public static int compareLong( long a, long b )
|
||||
public static int compareLong( final long a, final long b )
|
||||
{
|
||||
if( a == b )
|
||||
{
|
||||
@@ -150,7 +150,7 @@ public class ItemSorters
|
||||
return 1;
|
||||
}
|
||||
|
||||
public static int compareDouble( double a, double b )
|
||||
public static int compareDouble( final double a, final double b )
|
||||
{
|
||||
if( a == b )
|
||||
{
|
||||
|
||||
@@ -28,7 +28,7 @@ public class LookDirection
|
||||
public final Vec3 a;
|
||||
public final Vec3 b;
|
||||
|
||||
public LookDirection( Vec3 a, Vec3 b )
|
||||
public LookDirection( final Vec3 a, final Vec3 b )
|
||||
{
|
||||
this.a = a;
|
||||
this.b = b;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -30,7 +30,7 @@ public class ReadOnlyCollection<T> implements IReadOnlyCollection<T>
|
||||
|
||||
private final Collection<T> c;
|
||||
|
||||
public ReadOnlyCollection( Collection<T> in )
|
||||
public ReadOnlyCollection( final Collection<T> in )
|
||||
{
|
||||
this.c = in;
|
||||
}
|
||||
@@ -54,7 +54,7 @@ public class ReadOnlyCollection<T> implements IReadOnlyCollection<T>
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean contains( Object node )
|
||||
public boolean contains( final Object node )
|
||||
{
|
||||
return this.c.contains( node );
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ public enum ReadableNumberConverter implements ISlimReadableNumberConverter, IWi
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toSlimReadableForm( long number )
|
||||
public String toSlimReadableForm( final long number )
|
||||
{
|
||||
return this.toReadableFormRestrictedByWidth( number, 3 );
|
||||
}
|
||||
@@ -58,7 +58,7 @@ public enum ReadableNumberConverter implements ISlimReadableNumberConverter, IWi
|
||||
*
|
||||
* @return formatted number restricted by the width limitation
|
||||
*/
|
||||
private String toReadableFormRestrictedByWidth( long number, int width )
|
||||
private String toReadableFormRestrictedByWidth( final long number, final int width )
|
||||
{
|
||||
assert number >= 0;
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ public final class UUIDMatcher
|
||||
*
|
||||
* @return true, if the potential {@link java.util.UUID} is indeed an {@link java.util.UUID}
|
||||
*/
|
||||
public boolean isUUID( CharSequence potential )
|
||||
public boolean isUUID( final CharSequence potential )
|
||||
{
|
||||
return PATTERN.matcher( potential ).matches();
|
||||
}
|
||||
|
||||
@@ -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 );
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
|
||||
@@ -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 )
|
||||
{
|
||||
|
||||
@@ -51,7 +51,7 @@ public final class AEFluidStack extends AEStack<IAEFluidStack> implements IAEFlu
|
||||
Fluid fluid;
|
||||
private IAETagCompound tagCompound;
|
||||
|
||||
private AEFluidStack( AEFluidStack is )
|
||||
private AEFluidStack( final AEFluidStack is )
|
||||
{
|
||||
|
||||
this.fluid = is.fluid;
|
||||
@@ -64,7 +64,7 @@ public final class AEFluidStack extends AEStack<IAEFluidStack> implements IAEFlu
|
||||
this.myHash = is.myHash;
|
||||
}
|
||||
|
||||
private AEFluidStack( @Nonnull FluidStack is )
|
||||
private AEFluidStack( @Nonnull final FluidStack is )
|
||||
{
|
||||
this.fluid = is.getFluid();
|
||||
|
||||
@@ -80,14 +80,14 @@ public final class AEFluidStack extends AEStack<IAEFluidStack> implements IAEFlu
|
||||
this.myHash = this.fluid.hashCode() ^ ( this.tagCompound == null ? 0 : System.identityHashCode( this.tagCompound ) );
|
||||
}
|
||||
|
||||
public static IAEFluidStack loadFluidStackFromNBT( NBTTagCompound i )
|
||||
public static IAEFluidStack loadFluidStackFromNBT( final NBTTagCompound i )
|
||||
{
|
||||
ItemStack itemstack = ItemStack.loadItemStackFromNBT( i );
|
||||
final ItemStack itemstack = ItemStack.loadItemStackFromNBT( i );
|
||||
if( itemstack == null )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
AEFluidStack fluid = AEFluidStack.create( itemstack );
|
||||
final AEFluidStack fluid = AEFluidStack.create( itemstack );
|
||||
// fluid.priority = i.getInteger( "Priority" );
|
||||
fluid.stackSize = i.getLong( "Cnt" );
|
||||
fluid.setCountRequestable( i.getLong( "Req" ) );
|
||||
@@ -95,7 +95,7 @@ public final class AEFluidStack extends AEStack<IAEFluidStack> implements IAEFlu
|
||||
return fluid;
|
||||
}
|
||||
|
||||
public static AEFluidStack create( Object a )
|
||||
public static AEFluidStack create( final Object a )
|
||||
{
|
||||
if( a == null )
|
||||
{
|
||||
@@ -112,20 +112,20 @@ public final class AEFluidStack extends AEStack<IAEFluidStack> implements IAEFlu
|
||||
return null;
|
||||
}
|
||||
|
||||
public static IAEFluidStack loadFluidStackFromPacket( ByteBuf data ) throws IOException
|
||||
public static IAEFluidStack loadFluidStackFromPacket( final ByteBuf data ) throws IOException
|
||||
{
|
||||
byte mask = data.readByte();
|
||||
final byte mask = data.readByte();
|
||||
// byte PriorityType = (byte) (mask & 0x03);
|
||||
byte stackType = (byte) ( ( mask & 0x0C ) >> 2 );
|
||||
byte countReqType = (byte) ( ( mask & 0x30 ) >> 4 );
|
||||
boolean isCraftable = ( mask & 0x40 ) > 0;
|
||||
boolean hasTagCompound = ( mask & 0x80 ) > 0;
|
||||
final byte stackType = (byte) ( ( mask & 0x0C ) >> 2 );
|
||||
final byte countReqType = (byte) ( ( mask & 0x30 ) >> 4 );
|
||||
final boolean isCraftable = ( mask & 0x40 ) > 0;
|
||||
final boolean hasTagCompound = ( mask & 0x80 ) > 0;
|
||||
|
||||
// don't send this...
|
||||
NBTTagCompound d = new NBTTagCompound();
|
||||
final NBTTagCompound d = new NBTTagCompound();
|
||||
|
||||
byte len2 = data.readByte();
|
||||
byte[] name = new byte[len2];
|
||||
final byte len2 = data.readByte();
|
||||
final byte[] name = new byte[len2];
|
||||
data.readBytes( name, 0, len2 );
|
||||
|
||||
d.setString( "FluidName", new String( name, "UTF-8" ) );
|
||||
@@ -133,26 +133,26 @@ public final class AEFluidStack extends AEStack<IAEFluidStack> implements IAEFlu
|
||||
|
||||
if( hasTagCompound )
|
||||
{
|
||||
int len = data.readInt();
|
||||
final int len = data.readInt();
|
||||
|
||||
byte[] bd = new byte[len];
|
||||
final byte[] bd = new byte[len];
|
||||
data.readBytes( bd );
|
||||
|
||||
DataInputStream di = new DataInputStream( new ByteArrayInputStream( bd ) );
|
||||
final DataInputStream di = new DataInputStream( new ByteArrayInputStream( bd ) );
|
||||
d.setTag( "tag", CompressedStreamTools.read( di ) );
|
||||
}
|
||||
|
||||
// long priority = getPacketValue( PriorityType, data );
|
||||
long stackSize = getPacketValue( stackType, data );
|
||||
long countRequestable = getPacketValue( countReqType, data );
|
||||
final long stackSize = getPacketValue( stackType, data );
|
||||
final long countRequestable = getPacketValue( countReqType, data );
|
||||
|
||||
FluidStack fluidStack = FluidStack.loadFluidStackFromNBT( d );
|
||||
final FluidStack fluidStack = FluidStack.loadFluidStackFromNBT( d );
|
||||
if( fluidStack == null )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
AEFluidStack fluid = AEFluidStack.create( fluidStack );
|
||||
final AEFluidStack fluid = AEFluidStack.create( fluidStack );
|
||||
// fluid.priority = (int) priority;
|
||||
fluid.stackSize = stackSize;
|
||||
fluid.setCountRequestable( countRequestable );
|
||||
@@ -161,7 +161,7 @@ public final class AEFluidStack extends AEStack<IAEFluidStack> implements IAEFlu
|
||||
}
|
||||
|
||||
@Override
|
||||
public void add( IAEFluidStack option )
|
||||
public void add( final IAEFluidStack option )
|
||||
{
|
||||
if( option == null )
|
||||
{
|
||||
@@ -177,7 +177,7 @@ public final class AEFluidStack extends AEStack<IAEFluidStack> implements IAEFlu
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT( NBTTagCompound i )
|
||||
public void writeToNBT( final NBTTagCompound i )
|
||||
{
|
||||
/*
|
||||
* Mojang Fucked this over ; GC Optimization - Ugly Yes, but it saves a lot in the memory department.
|
||||
@@ -226,7 +226,7 @@ public final class AEFluidStack extends AEStack<IAEFluidStack> implements IAEFlu
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean fuzzyComparison( Object st, FuzzyMode mode )
|
||||
public boolean fuzzyComparison( final Object st, final FuzzyMode mode )
|
||||
{
|
||||
if( st instanceof FluidStack )
|
||||
{
|
||||
@@ -250,7 +250,7 @@ public final class AEFluidStack extends AEStack<IAEFluidStack> implements IAEFlu
|
||||
@Override
|
||||
public IAEFluidStack empty()
|
||||
{
|
||||
IAEFluidStack dup = this.copy();
|
||||
final IAEFluidStack dup = this.copy();
|
||||
dup.reset();
|
||||
return dup;
|
||||
}
|
||||
@@ -280,9 +280,9 @@ public final class AEFluidStack extends AEStack<IAEFluidStack> implements IAEFlu
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo( AEFluidStack b )
|
||||
public int compareTo( final AEFluidStack b )
|
||||
{
|
||||
int diff = this.hashCode() - b.hashCode();
|
||||
final int diff = this.hashCode() - b.hashCode();
|
||||
return diff > 0 ? 1 : ( diff < 0 ? -1 : 0 );
|
||||
}
|
||||
|
||||
@@ -293,7 +293,7 @@ public final class AEFluidStack extends AEStack<IAEFluidStack> implements IAEFlu
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals( Object ia )
|
||||
public boolean equals( final Object ia )
|
||||
{
|
||||
if( ia instanceof AEFluidStack )
|
||||
{
|
||||
@@ -301,12 +301,12 @@ public final class AEFluidStack extends AEStack<IAEFluidStack> implements IAEFlu
|
||||
}
|
||||
else if( ia instanceof FluidStack )
|
||||
{
|
||||
FluidStack is = (FluidStack) ia;
|
||||
final FluidStack is = (FluidStack) ia;
|
||||
|
||||
if( is.getFluidID() == this.fluid.getID() )
|
||||
{
|
||||
NBTTagCompound ta = (NBTTagCompound) this.tagCompound;
|
||||
NBTTagCompound tb = is.tag;
|
||||
final NBTTagCompound ta = (NBTTagCompound) this.tagCompound;
|
||||
final NBTTagCompound tb = is.tag;
|
||||
if( ta == tb )
|
||||
{
|
||||
return true;
|
||||
@@ -346,7 +346,7 @@ public final class AEFluidStack extends AEStack<IAEFluidStack> implements IAEFlu
|
||||
@Override
|
||||
public FluidStack getFluidStack()
|
||||
{
|
||||
FluidStack is = new FluidStack( this.fluid, (int) Math.min( Integer.MAX_VALUE, this.stackSize ) );
|
||||
final FluidStack is = new FluidStack( this.fluid, (int) Math.min( Integer.MAX_VALUE, this.stackSize ) );
|
||||
if( this.tagCompound != null )
|
||||
{
|
||||
is.tag = this.tagCompound.getNBTTagCompoundCopy();
|
||||
@@ -364,25 +364,25 @@ public final class AEFluidStack extends AEStack<IAEFluidStack> implements IAEFlu
|
||||
|
||||
|
||||
@Override
|
||||
void writeIdentity( ByteBuf i ) throws IOException
|
||||
void writeIdentity( final ByteBuf i ) throws IOException
|
||||
{
|
||||
byte[] name = this.fluid.getName().getBytes( "UTF-8" );
|
||||
final byte[] name = this.fluid.getName().getBytes( "UTF-8" );
|
||||
i.writeByte( (byte) name.length );
|
||||
i.writeBytes( name );
|
||||
}
|
||||
|
||||
@Override
|
||||
void readNBT( ByteBuf i ) throws IOException
|
||||
void readNBT( final ByteBuf i ) throws IOException
|
||||
{
|
||||
if( this.hasTagCompound() )
|
||||
{
|
||||
ByteArrayOutputStream bytes = new ByteArrayOutputStream();
|
||||
DataOutputStream data = new DataOutputStream( bytes );
|
||||
final ByteArrayOutputStream bytes = new ByteArrayOutputStream();
|
||||
final DataOutputStream data = new DataOutputStream( bytes );
|
||||
|
||||
CompressedStreamTools.write( (NBTTagCompound) this.tagCompound, data );
|
||||
|
||||
byte[] tagBytes = bytes.toByteArray();
|
||||
int size = tagBytes.length;
|
||||
final byte[] tagBytes = bytes.toByteArray();
|
||||
final int size = tagBytes.length;
|
||||
|
||||
i.writeInt( size );
|
||||
i.writeBytes( tagBytes );
|
||||
|
||||
@@ -51,7 +51,7 @@ public class AEItemDef
|
||||
public UniqueIdentifier uniqueID;
|
||||
public OreReference isOre;
|
||||
|
||||
public AEItemDef( Item it )
|
||||
public AEItemDef( final Item it )
|
||||
{
|
||||
this.item = it;
|
||||
this.itemID = Item.getIdFromItem( it );
|
||||
@@ -59,7 +59,7 @@ public class AEItemDef
|
||||
|
||||
public AEItemDef copy()
|
||||
{
|
||||
AEItemDef t = new AEItemDef( this.item );
|
||||
final AEItemDef t = new AEItemDef( this.item );
|
||||
t.def = this.def;
|
||||
t.damageValue = this.damageValue;
|
||||
t.displayDamage = this.displayDamage;
|
||||
@@ -70,7 +70,7 @@ public class AEItemDef
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals( Object obj )
|
||||
public boolean equals( final Object obj )
|
||||
{
|
||||
if( obj == null )
|
||||
{
|
||||
@@ -80,14 +80,14 @@ public class AEItemDef
|
||||
{
|
||||
return false;
|
||||
}
|
||||
AEItemDef other = (AEItemDef) obj;
|
||||
final AEItemDef other = (AEItemDef) obj;
|
||||
return other.damageValue == this.damageValue && other.item == this.item && this.tagCompound == other.tagCompound;
|
||||
}
|
||||
|
||||
public boolean isItem( ItemStack otherStack )
|
||||
public boolean isItem( final ItemStack otherStack )
|
||||
{
|
||||
// hackery!
|
||||
int dmg = this.getDamageValueHack( otherStack );
|
||||
final int dmg = this.getDamageValueHack( otherStack );
|
||||
|
||||
if( this.item == otherStack.getItem() && dmg == this.damageValue )
|
||||
{
|
||||
@@ -106,7 +106,7 @@ public class AEItemDef
|
||||
return false;
|
||||
}
|
||||
|
||||
public int getDamageValueHack( ItemStack is )
|
||||
public int getDamageValueHack( final ItemStack is )
|
||||
{
|
||||
return Items.blaze_rod.getDamage( is );
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
|
||||
|
||||
AEItemDef def;
|
||||
|
||||
private AEItemStack( AEItemStack is )
|
||||
private AEItemStack( final AEItemStack is )
|
||||
{
|
||||
this.def = is.def;
|
||||
this.stackSize = is.stackSize;
|
||||
@@ -59,7 +59,7 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
|
||||
this.setCountRequestable( is.getCountRequestable() );
|
||||
}
|
||||
|
||||
private AEItemStack( ItemStack is )
|
||||
private AEItemStack( final ItemStack is )
|
||||
{
|
||||
if( is == null )
|
||||
{
|
||||
@@ -96,7 +96,7 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
|
||||
this.def.displayDamage = ( int ) ( is.getItem().getDurabilityForDisplay( is ) * Integer.MAX_VALUE );
|
||||
this.def.maxDamage = is.getMaxDamage();
|
||||
|
||||
NBTTagCompound tagCompound = is.getTagCompound();
|
||||
final NBTTagCompound tagCompound = is.getTagCompound();
|
||||
if( tagCompound != null )
|
||||
{
|
||||
this.def.tagCompound = (AESharedNBT) AESharedNBT.getSharedTagCompound( tagCompound, is );
|
||||
@@ -110,20 +110,20 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
|
||||
this.def.isOre = OreHelper.INSTANCE.isOre( is );
|
||||
}
|
||||
|
||||
public static IAEItemStack loadItemStackFromNBT( NBTTagCompound i )
|
||||
public static IAEItemStack loadItemStackFromNBT( final NBTTagCompound i )
|
||||
{
|
||||
if( i == null )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
ItemStack itemstack = ItemStack.loadItemStackFromNBT( i );
|
||||
final ItemStack itemstack = ItemStack.loadItemStackFromNBT( i );
|
||||
if( itemstack == null )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
AEItemStack item = AEItemStack.create( itemstack );
|
||||
final AEItemStack item = AEItemStack.create( itemstack );
|
||||
// item.priority = i.getInteger( "Priority" );
|
||||
item.stackSize = i.getLong( "Cnt" );
|
||||
item.setCountRequestable( i.getLong( "Req" ) );
|
||||
@@ -132,7 +132,7 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static AEItemStack create( ItemStack stack )
|
||||
public static AEItemStack create( final ItemStack stack )
|
||||
{
|
||||
if( stack == null )
|
||||
{
|
||||
@@ -142,17 +142,17 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
|
||||
return new AEItemStack( stack );
|
||||
}
|
||||
|
||||
public static IAEItemStack loadItemStackFromPacket( ByteBuf data ) throws IOException
|
||||
public static IAEItemStack loadItemStackFromPacket( final ByteBuf data ) throws IOException
|
||||
{
|
||||
byte mask = data.readByte();
|
||||
final byte mask = data.readByte();
|
||||
// byte PriorityType = (byte) (mask & 0x03);
|
||||
byte stackType = (byte) ( ( mask & 0x0C ) >> 2 );
|
||||
byte countReqType = (byte) ( ( mask & 0x30 ) >> 4 );
|
||||
boolean isCraftable = ( mask & 0x40 ) > 0;
|
||||
boolean hasTagCompound = ( mask & 0x80 ) > 0;
|
||||
final byte stackType = (byte) ( ( mask & 0x0C ) >> 2 );
|
||||
final byte countReqType = (byte) ( ( mask & 0x30 ) >> 4 );
|
||||
final boolean isCraftable = ( mask & 0x40 ) > 0;
|
||||
final boolean hasTagCompound = ( mask & 0x80 ) > 0;
|
||||
|
||||
// don't send this...
|
||||
NBTTagCompound d = new NBTTagCompound();
|
||||
final NBTTagCompound d = new NBTTagCompound();
|
||||
|
||||
d.setShort( "id", data.readShort() );
|
||||
d.setShort( "Damage", data.readShort() );
|
||||
@@ -160,26 +160,26 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
|
||||
|
||||
if( hasTagCompound )
|
||||
{
|
||||
int len = data.readInt();
|
||||
final int len = data.readInt();
|
||||
|
||||
byte[] bd = new byte[len];
|
||||
final byte[] bd = new byte[len];
|
||||
data.readBytes( bd );
|
||||
|
||||
ByteArrayInputStream di = new ByteArrayInputStream( bd );
|
||||
final ByteArrayInputStream di = new ByteArrayInputStream( bd );
|
||||
d.setTag( "tag", CompressedStreamTools.read( new DataInputStream( di ) ) );
|
||||
}
|
||||
|
||||
// long priority = getPacketValue( PriorityType, data );
|
||||
long stackSize = getPacketValue( stackType, data );
|
||||
long countRequestable = getPacketValue( countReqType, data );
|
||||
final long stackSize = getPacketValue( stackType, data );
|
||||
final long countRequestable = getPacketValue( countReqType, data );
|
||||
|
||||
ItemStack itemstack = ItemStack.loadItemStackFromNBT( d );
|
||||
final ItemStack itemstack = ItemStack.loadItemStackFromNBT( d );
|
||||
if( itemstack == null )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
AEItemStack item = AEItemStack.create( itemstack );
|
||||
final AEItemStack item = AEItemStack.create( itemstack );
|
||||
// item.priority = (int) priority;
|
||||
item.stackSize = stackSize;
|
||||
item.setCountRequestable( countRequestable );
|
||||
@@ -188,7 +188,7 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
|
||||
}
|
||||
|
||||
@Override
|
||||
public void add( IAEItemStack option )
|
||||
public void add( final IAEItemStack option )
|
||||
{
|
||||
if( option == null )
|
||||
{
|
||||
@@ -204,7 +204,7 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT( NBTTagCompound i )
|
||||
public void writeToNBT( final NBTTagCompound i )
|
||||
{
|
||||
/*
|
||||
* Mojang Fucked this over ; GC Optimization - Ugly Yes, but it saves a lot in the memory department.
|
||||
@@ -258,11 +258,11 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean fuzzyComparison( Object st, FuzzyMode mode )
|
||||
public boolean fuzzyComparison( final Object st, final FuzzyMode mode )
|
||||
{
|
||||
if( st instanceof IAEItemStack )
|
||||
{
|
||||
IAEItemStack o = (IAEItemStack) st;
|
||||
final IAEItemStack o = (IAEItemStack) st;
|
||||
|
||||
if( this.sameOre( o ) )
|
||||
{
|
||||
@@ -273,8 +273,8 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
|
||||
{
|
||||
if( this.def.item.isDamageable() )
|
||||
{
|
||||
ItemStack a = this.getItemStack();
|
||||
ItemStack b = o.getItemStack();
|
||||
final ItemStack a = this.getItemStack();
|
||||
final ItemStack b = o.getItemStack();
|
||||
|
||||
try
|
||||
{
|
||||
@@ -284,23 +284,23 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
|
||||
}
|
||||
else if( mode == FuzzyMode.PERCENT_99 )
|
||||
{
|
||||
Item ai = a.getItem();
|
||||
Item bi = b.getItem();
|
||||
final Item ai = a.getItem();
|
||||
final Item bi = b.getItem();
|
||||
|
||||
return ( ai.getDurabilityForDisplay( a ) < 0.001f ) == ( bi.getDurabilityForDisplay( b ) < 0.001f );
|
||||
}
|
||||
else
|
||||
{
|
||||
Item ai = a.getItem();
|
||||
Item bi = b.getItem();
|
||||
final Item ai = a.getItem();
|
||||
final Item bi = b.getItem();
|
||||
|
||||
float percentDamageOfA = 1.0f - (float) ai.getDurabilityForDisplay(a);
|
||||
float percentDamageOfB = 1.0f - (float) bi.getDurabilityForDisplay(b);
|
||||
final float percentDamageOfA = 1.0f - (float) ai.getDurabilityForDisplay(a);
|
||||
final float percentDamageOfB = 1.0f - (float) bi.getDurabilityForDisplay(b);
|
||||
|
||||
return ( percentDamageOfA > mode.breakPoint ) == ( percentDamageOfB > mode.breakPoint );
|
||||
}
|
||||
}
|
||||
catch( Throwable e )
|
||||
catch( final Throwable e )
|
||||
{
|
||||
if( mode == FuzzyMode.IGNORE_ALL )
|
||||
{
|
||||
@@ -312,8 +312,8 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
|
||||
}
|
||||
else
|
||||
{
|
||||
float percentDamageOfA = (float) a.getItemDamage() / (float) a.getMaxDamage();
|
||||
float percentDamageOfB = (float) b.getItemDamage() / (float) b.getMaxDamage();
|
||||
final float percentDamageOfA = (float) a.getItemDamage() / (float) a.getMaxDamage();
|
||||
final float percentDamageOfB = (float) b.getItemDamage() / (float) b.getMaxDamage();
|
||||
|
||||
return ( percentDamageOfA > mode.breakPoint ) == ( percentDamageOfB > mode.breakPoint );
|
||||
}
|
||||
@@ -326,7 +326,7 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
|
||||
|
||||
if( st instanceof ItemStack )
|
||||
{
|
||||
ItemStack o = (ItemStack) st;
|
||||
final ItemStack o = (ItemStack) st;
|
||||
|
||||
OreHelper.INSTANCE.sameOre( this, o );
|
||||
|
||||
@@ -334,7 +334,7 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
|
||||
{
|
||||
if( this.def.item.isDamageable() )
|
||||
{
|
||||
ItemStack a = this.getItemStack();
|
||||
final ItemStack a = this.getItemStack();
|
||||
|
||||
try
|
||||
{
|
||||
@@ -344,23 +344,23 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
|
||||
}
|
||||
else if( mode == FuzzyMode.PERCENT_99 )
|
||||
{
|
||||
Item ai = a.getItem();
|
||||
Item bi = o.getItem();
|
||||
final Item ai = a.getItem();
|
||||
final Item bi = o.getItem();
|
||||
|
||||
return ( ai.getDurabilityForDisplay( a ) < 0.001f ) == ( bi.getDurabilityForDisplay( o ) < 0.001f );
|
||||
}
|
||||
else
|
||||
{
|
||||
Item ai = a.getItem();
|
||||
Item bi = o.getItem();
|
||||
final Item ai = a.getItem();
|
||||
final Item bi = o.getItem();
|
||||
|
||||
float percentDamageOfA = 1.0f - (float) ai.getDurabilityForDisplay(a);
|
||||
float percentDamageOfB = 1.0f - (float) bi.getDurabilityForDisplay(o);
|
||||
final float percentDamageOfA = 1.0f - (float) ai.getDurabilityForDisplay(a);
|
||||
final float percentDamageOfB = 1.0f - (float) bi.getDurabilityForDisplay(o);
|
||||
|
||||
return ( percentDamageOfA > mode.breakPoint ) == ( percentDamageOfB > mode.breakPoint );
|
||||
}
|
||||
}
|
||||
catch( Throwable e )
|
||||
catch( final Throwable e )
|
||||
{
|
||||
if( mode == FuzzyMode.IGNORE_ALL )
|
||||
{
|
||||
@@ -372,8 +372,8 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
|
||||
}
|
||||
else
|
||||
{
|
||||
float percentDamageOfA = (float) a.getItemDamage() / (float) a.getMaxDamage();
|
||||
float percentDamageOfB = (float) o.getItemDamage() / (float) o.getMaxDamage();
|
||||
final float percentDamageOfA = (float) a.getItemDamage() / (float) a.getMaxDamage();
|
||||
final float percentDamageOfB = (float) o.getItemDamage() / (float) o.getMaxDamage();
|
||||
|
||||
return ( percentDamageOfA > mode.breakPoint ) == ( percentDamageOfB > mode.breakPoint );
|
||||
}
|
||||
@@ -396,7 +396,7 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
|
||||
@Override
|
||||
public IAEItemStack empty()
|
||||
{
|
||||
IAEItemStack dup = this.copy();
|
||||
final IAEItemStack dup = this.copy();
|
||||
dup.reset();
|
||||
return dup;
|
||||
}
|
||||
@@ -428,7 +428,7 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
|
||||
@Override
|
||||
public ItemStack getItemStack()
|
||||
{
|
||||
ItemStack is = new ItemStack( this.def.item, (int) Math.min( Integer.MAX_VALUE, this.stackSize ), this.def.damageValue );
|
||||
final ItemStack is = new ItemStack( this.def.item, (int) Math.min( Integer.MAX_VALUE, this.stackSize ), this.def.damageValue );
|
||||
if( this.def.tagCompound != null )
|
||||
{
|
||||
is.setTagCompound( this.def.tagCompound.getNBTTagCompoundCopy() );
|
||||
@@ -450,13 +450,13 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean sameOre( IAEItemStack is )
|
||||
public boolean sameOre( final IAEItemStack is )
|
||||
{
|
||||
return OreHelper.INSTANCE.sameOre( this, is );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSameType( IAEItemStack otherStack )
|
||||
public boolean isSameType( final IAEItemStack otherStack )
|
||||
{
|
||||
if( otherStack == null )
|
||||
{
|
||||
@@ -467,7 +467,7 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSameType( ItemStack otherStack )
|
||||
public boolean isSameType( final ItemStack otherStack )
|
||||
{
|
||||
if( otherStack == null )
|
||||
{
|
||||
@@ -484,7 +484,7 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals( Object ia )
|
||||
public boolean equals( final Object ia )
|
||||
{
|
||||
if( ia instanceof AEItemStack )
|
||||
{
|
||||
@@ -492,12 +492,12 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
|
||||
}
|
||||
else if( ia instanceof ItemStack )
|
||||
{
|
||||
ItemStack is = (ItemStack) ia;
|
||||
final ItemStack is = (ItemStack) ia;
|
||||
|
||||
if( is.getItem() == this.def.item && is.getItemDamage() == this.def.damageValue )
|
||||
{
|
||||
NBTTagCompound ta = this.def.tagCompound;
|
||||
NBTTagCompound tb = is.getTagCompound();
|
||||
final NBTTagCompound ta = this.def.tagCompound;
|
||||
final NBTTagCompound tb = is.getTagCompound();
|
||||
if( ta == tb )
|
||||
{
|
||||
return true;
|
||||
@@ -531,21 +531,21 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo( AEItemStack b )
|
||||
public int compareTo( final AEItemStack b )
|
||||
{
|
||||
int id = this.def.itemID - b.def.itemID;
|
||||
final int id = this.def.itemID - b.def.itemID;
|
||||
if( id != 0 )
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
int damageValue = this.def.damageValue - b.def.damageValue;
|
||||
final int damageValue = this.def.damageValue - b.def.damageValue;
|
||||
if( damageValue != 0 )
|
||||
{
|
||||
return damageValue;
|
||||
}
|
||||
|
||||
int displayDamage = this.def.displayDamage - b.def.displayDamage;
|
||||
final int displayDamage = this.def.displayDamage - b.def.displayDamage;
|
||||
if( displayDamage != 0 )
|
||||
{
|
||||
return displayDamage;
|
||||
@@ -554,9 +554,9 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
|
||||
return ( this.def.tagCompound == b.def.tagCompound ) ? 0 : this.compareNBT( b.def );
|
||||
}
|
||||
|
||||
private int compareNBT( AEItemDef b )
|
||||
private int compareNBT( final AEItemDef b )
|
||||
{
|
||||
int nbt = this.compare( ( this.def.tagCompound == null ? 0 : this.def.tagCompound.getHash() ), ( b.tagCompound == null ? 0 : b.tagCompound.getHash() ) );
|
||||
final int nbt = this.compare( ( this.def.tagCompound == null ? 0 : this.def.tagCompound.getHash() ), ( b.tagCompound == null ? 0 : b.tagCompound.getHash() ) );
|
||||
if( nbt == 0 )
|
||||
{
|
||||
return this.compare( System.identityHashCode( this.def.tagCompound ), System.identityHashCode( b.tagCompound ) );
|
||||
@@ -564,7 +564,7 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
|
||||
return nbt;
|
||||
}
|
||||
|
||||
private int compare( int l, int m )
|
||||
private int compare( final int l, final int m )
|
||||
{
|
||||
return l < m ? -1 : ( l > m ? 1 : 0 );
|
||||
}
|
||||
@@ -602,7 +602,7 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
|
||||
return this.getModName( this.def.uniqueID = GameRegistry.findUniqueIdentifierFor( this.def.item ) );
|
||||
}
|
||||
|
||||
private String getModName( UniqueIdentifier uniqueIdentifier )
|
||||
private String getModName( final UniqueIdentifier uniqueIdentifier )
|
||||
{
|
||||
if( uniqueIdentifier == null )
|
||||
{
|
||||
@@ -612,10 +612,10 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
|
||||
return uniqueIdentifier.modId == null ? "** Null" : uniqueIdentifier.modId;
|
||||
}
|
||||
|
||||
public IAEItemStack getLow( FuzzyMode fuzzy, boolean ignoreMeta )
|
||||
public IAEItemStack getLow( final FuzzyMode fuzzy, final boolean ignoreMeta )
|
||||
{
|
||||
AEItemStack bottom = new AEItemStack( this );
|
||||
AEItemDef newDef = bottom.def = bottom.def.copy();
|
||||
final AEItemStack bottom = new AEItemStack( this );
|
||||
final AEItemDef newDef = bottom.def = bottom.def.copy();
|
||||
|
||||
if( ignoreMeta )
|
||||
{
|
||||
@@ -643,7 +643,7 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
|
||||
}
|
||||
else
|
||||
{
|
||||
int breakpoint = fuzzy.calculateBreakPoint( this.def.maxDamage );
|
||||
final int breakpoint = fuzzy.calculateBreakPoint( this.def.maxDamage );
|
||||
newDef.displayDamage = breakpoint <= this.def.displayDamage ? breakpoint : 0;
|
||||
}
|
||||
|
||||
@@ -655,10 +655,10 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
|
||||
return bottom;
|
||||
}
|
||||
|
||||
public IAEItemStack getHigh( FuzzyMode fuzzy, boolean ignoreMeta )
|
||||
public IAEItemStack getHigh( final FuzzyMode fuzzy, final boolean ignoreMeta )
|
||||
{
|
||||
AEItemStack top = new AEItemStack( this );
|
||||
AEItemDef newDef = top.def = top.def.copy();
|
||||
final AEItemStack top = new AEItemStack( this );
|
||||
final AEItemDef newDef = top.def = top.def.copy();
|
||||
|
||||
if( ignoreMeta )
|
||||
{
|
||||
@@ -686,7 +686,7 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
|
||||
}
|
||||
else
|
||||
{
|
||||
int breakpoint = fuzzy.calculateBreakPoint( this.def.maxDamage );
|
||||
final int breakpoint = fuzzy.calculateBreakPoint( this.def.maxDamage );
|
||||
newDef.displayDamage = this.def.displayDamage < breakpoint ? breakpoint - 1 : this.def.maxDamage + 1;
|
||||
}
|
||||
|
||||
@@ -704,24 +704,24 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
|
||||
}
|
||||
|
||||
@Override
|
||||
void writeIdentity( ByteBuf i ) throws IOException
|
||||
void writeIdentity( final ByteBuf i ) throws IOException
|
||||
{
|
||||
i.writeShort( Item.itemRegistry.getIDForObject( this.def.item ) );
|
||||
i.writeShort( this.getItemDamage() );
|
||||
}
|
||||
|
||||
@Override
|
||||
void readNBT( ByteBuf i ) throws IOException
|
||||
void readNBT( final ByteBuf i ) throws IOException
|
||||
{
|
||||
if( this.hasTagCompound() )
|
||||
{
|
||||
ByteArrayOutputStream bytes = new ByteArrayOutputStream();
|
||||
DataOutputStream data = new DataOutputStream( bytes );
|
||||
final ByteArrayOutputStream bytes = new ByteArrayOutputStream();
|
||||
final DataOutputStream data = new DataOutputStream( bytes );
|
||||
|
||||
CompressedStreamTools.write( (NBTTagCompound) this.getTagCompound(), data );
|
||||
|
||||
byte[] tagBytes = bytes.toByteArray();
|
||||
int size = tagBytes.length;
|
||||
final byte[] tagBytes = bytes.toByteArray();
|
||||
final int size = tagBytes.length;
|
||||
|
||||
i.writeInt( size );
|
||||
i.writeBytes( tagBytes );
|
||||
|
||||
@@ -47,13 +47,13 @@ public class AESharedNBT extends NBTTagCompound implements IAETagCompound
|
||||
private int hash;
|
||||
private IItemComparison comp;
|
||||
|
||||
private AESharedNBT( Item itemID, int damageValue )
|
||||
private AESharedNBT( final Item itemID, final int damageValue )
|
||||
{
|
||||
this.item = itemID;
|
||||
this.meta = damageValue;
|
||||
}
|
||||
|
||||
public AESharedNBT( int fakeValue )
|
||||
public AESharedNBT( final int fakeValue )
|
||||
{
|
||||
this.item = null;
|
||||
this.meta = 0;
|
||||
@@ -71,14 +71,14 @@ public class AESharedNBT extends NBTTagCompound implements IAETagCompound
|
||||
/*
|
||||
* Returns an NBT Compound that is used for accelerating comparisons.
|
||||
*/
|
||||
public static synchronized NBTTagCompound getSharedTagCompound( NBTTagCompound tagCompound, ItemStack s )
|
||||
public static synchronized NBTTagCompound getSharedTagCompound( final NBTTagCompound tagCompound, final ItemStack s )
|
||||
{
|
||||
if( tagCompound.hasNoTags() )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
Item item = s.getItem();
|
||||
final Item item = s.getItem();
|
||||
int meta = -1;
|
||||
if( s.getItem() != null && s.isItemStackDamageable() && s.getHasSubtypes() )
|
||||
{
|
||||
@@ -90,12 +90,12 @@ public class AESharedNBT extends NBTTagCompound implements IAETagCompound
|
||||
return tagCompound;
|
||||
}
|
||||
|
||||
SharedSearchObject sso = new SharedSearchObject( item, meta, tagCompound );
|
||||
final SharedSearchObject sso = new SharedSearchObject( item, meta, tagCompound );
|
||||
|
||||
WeakReference<SharedSearchObject> c = SHARED_TAG_COMPOUND.get( sso );
|
||||
final WeakReference<SharedSearchObject> c = SHARED_TAG_COMPOUND.get( sso );
|
||||
if( c != null )
|
||||
{
|
||||
SharedSearchObject cg = c.get();
|
||||
final SharedSearchObject cg = c.get();
|
||||
if( cg != null )
|
||||
{
|
||||
return cg.shared; // I don't think I really need to check this
|
||||
@@ -103,7 +103,7 @@ public class AESharedNBT extends NBTTagCompound implements IAETagCompound
|
||||
// as its already certain to exist..
|
||||
}
|
||||
|
||||
AESharedNBT clone = AESharedNBT.createFromCompound( item, meta, tagCompound );
|
||||
final AESharedNBT clone = AESharedNBT.createFromCompound( item, meta, tagCompound );
|
||||
sso.compound = (NBTTagCompound) sso.compound.copy(); // prevent
|
||||
// modification
|
||||
// of data based
|
||||
@@ -119,25 +119,25 @@ public class AESharedNBT extends NBTTagCompound implements IAETagCompound
|
||||
/*
|
||||
* returns true if the compound is part of the shared compound system ( and can thus be compared directly ).
|
||||
*/
|
||||
public static boolean isShared( NBTTagCompound ta )
|
||||
public static boolean isShared( final NBTTagCompound ta )
|
||||
{
|
||||
return ta instanceof AESharedNBT;
|
||||
}
|
||||
|
||||
public static AESharedNBT createFromCompound( Item itemID, int damageValue, NBTTagCompound c )
|
||||
public static AESharedNBT createFromCompound( final Item itemID, final int damageValue, final NBTTagCompound c )
|
||||
{
|
||||
AESharedNBT x = new AESharedNBT( itemID, damageValue );
|
||||
final AESharedNBT x = new AESharedNBT( itemID, damageValue );
|
||||
|
||||
// c.getTags()
|
||||
for( Object o : c.getKeySet() )
|
||||
for( final Object o : c.getKeySet() )
|
||||
{
|
||||
String name = (String) o;
|
||||
final String name = (String) o;
|
||||
x.setTag( name, c.getTag( name ).copy() );
|
||||
}
|
||||
|
||||
x.hash = Platform.NBTOrderlessHash( c );
|
||||
|
||||
ItemStack isc = new ItemStack( itemID, 1, damageValue );
|
||||
final ItemStack isc = new ItemStack( itemID, 1, damageValue );
|
||||
isc.setTagCompound( c );
|
||||
x.comp = AEApi.instance().registries().specialComparison().getSpecialComparison( isc );
|
||||
|
||||
@@ -162,7 +162,7 @@ public class AESharedNBT extends NBTTagCompound implements IAETagCompound
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals( Object par1Obj )
|
||||
public boolean equals( final Object par1Obj )
|
||||
{
|
||||
if( par1Obj instanceof AESharedNBT )
|
||||
{
|
||||
@@ -171,12 +171,12 @@ public class AESharedNBT extends NBTTagCompound implements IAETagCompound
|
||||
return super.equals( par1Obj );
|
||||
}
|
||||
|
||||
public boolean matches( Item item, int meta, int orderlessHash )
|
||||
public boolean matches( final Item item, final int meta, final int orderlessHash )
|
||||
{
|
||||
return item == this.item && this.meta == meta && this.hash == orderlessHash;
|
||||
}
|
||||
|
||||
public boolean comparePreciseWithRegistry( AESharedNBT tagCompound )
|
||||
public boolean comparePreciseWithRegistry( final AESharedNBT tagCompound )
|
||||
{
|
||||
if( this == tagCompound )
|
||||
{
|
||||
@@ -191,7 +191,7 @@ public class AESharedNBT extends NBTTagCompound implements IAETagCompound
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean compareFuzzyWithRegistry( AESharedNBT tagCompound )
|
||||
public boolean compareFuzzyWithRegistry( final AESharedNBT tagCompound )
|
||||
{
|
||||
if( this == tagCompound )
|
||||
{
|
||||
|
||||
@@ -33,7 +33,7 @@ public abstract class AEStack<StackType extends IAEStack> implements IAEStack<St
|
||||
protected long stackSize;
|
||||
protected long countRequestable;
|
||||
|
||||
static long getPacketValue( byte type, ByteBuf tag )
|
||||
static long getPacketValue( final byte type, final ByteBuf tag )
|
||||
{
|
||||
if( type == 0 )
|
||||
{
|
||||
@@ -64,7 +64,7 @@ public abstract class AEStack<StackType extends IAEStack> implements IAEStack<St
|
||||
}
|
||||
|
||||
@Override
|
||||
public StackType setStackSize( long ss )
|
||||
public StackType setStackSize( final long ss )
|
||||
{
|
||||
this.stackSize = ss;
|
||||
return (StackType) this;
|
||||
@@ -77,7 +77,7 @@ public abstract class AEStack<StackType extends IAEStack> implements IAEStack<St
|
||||
}
|
||||
|
||||
@Override
|
||||
public StackType setCountRequestable( long countRequestable )
|
||||
public StackType setCountRequestable( final long countRequestable )
|
||||
{
|
||||
this.countRequestable = countRequestable;
|
||||
return (StackType) this;
|
||||
@@ -90,7 +90,7 @@ public abstract class AEStack<StackType extends IAEStack> implements IAEStack<St
|
||||
}
|
||||
|
||||
@Override
|
||||
public StackType setCraftable( boolean isCraftable )
|
||||
public StackType setCraftable( final boolean isCraftable )
|
||||
{
|
||||
this.isCraftable = isCraftable;
|
||||
return (StackType) this;
|
||||
@@ -113,33 +113,33 @@ public abstract class AEStack<StackType extends IAEStack> implements IAEStack<St
|
||||
}
|
||||
|
||||
@Override
|
||||
public void incStackSize( long i )
|
||||
public void incStackSize( final long i )
|
||||
{
|
||||
this.stackSize += i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void decStackSize( long i )
|
||||
public void decStackSize( final long i )
|
||||
{
|
||||
this.stackSize -= i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void incCountRequestable( long i )
|
||||
public void incCountRequestable( final long i )
|
||||
{
|
||||
this.countRequestable += i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void decCountRequestable( long i )
|
||||
public void decCountRequestable( final long i )
|
||||
{
|
||||
this.countRequestable -= i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToPacket( ByteBuf i ) throws IOException
|
||||
public void writeToPacket( final ByteBuf i ) throws IOException
|
||||
{
|
||||
byte mask = (byte) ( this.getType( 0 ) | ( this.getType( this.stackSize ) << 2 ) | ( this.getType( this.countRequestable ) << 4 ) | ( (byte) ( this.isCraftable ? 1 : 0 ) << 6 ) | ( this.hasTagCompound() ? 1 : 0 ) << 7 );
|
||||
final byte mask = (byte) ( this.getType( 0 ) | ( this.getType( this.stackSize ) << 2 ) | ( this.getType( this.countRequestable ) << 4 ) | ( (byte) ( this.isCraftable ? 1 : 0 ) << 6 ) | ( this.hasTagCompound() ? 1 : 0 ) << 7 );
|
||||
|
||||
i.writeByte( mask );
|
||||
this.writeIdentity( i );
|
||||
@@ -151,7 +151,7 @@ public abstract class AEStack<StackType extends IAEStack> implements IAEStack<St
|
||||
this.putPacketValue( i, this.countRequestable );
|
||||
}
|
||||
|
||||
byte getType( long num )
|
||||
byte getType( final long num )
|
||||
{
|
||||
if( num <= 255 )
|
||||
{
|
||||
@@ -177,7 +177,7 @@ public abstract class AEStack<StackType extends IAEStack> implements IAEStack<St
|
||||
|
||||
abstract void readNBT( ByteBuf i ) throws IOException;
|
||||
|
||||
void putPacketValue( ByteBuf tag, long num )
|
||||
void putPacketValue( final ByteBuf tag, final long num )
|
||||
{
|
||||
if( num <= 255 )
|
||||
{
|
||||
|
||||
@@ -36,7 +36,7 @@ public final class FluidList implements IItemList<IAEFluidStack>
|
||||
private final Map<IAEFluidStack, IAEFluidStack> records = new HashMap<IAEFluidStack, IAEFluidStack>();
|
||||
|
||||
@Override
|
||||
public void add( IAEFluidStack option )
|
||||
public void add( final IAEFluidStack option )
|
||||
{
|
||||
if( option == null )
|
||||
{
|
||||
@@ -57,7 +57,7 @@ public final class FluidList implements IItemList<IAEFluidStack>
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAEFluidStack findPrecise( IAEFluidStack fluidStack )
|
||||
public IAEFluidStack findPrecise( final IAEFluidStack fluidStack )
|
||||
{
|
||||
if( fluidStack == null )
|
||||
{
|
||||
@@ -68,7 +68,7 @@ public final class FluidList implements IItemList<IAEFluidStack>
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<IAEFluidStack> findFuzzy( IAEFluidStack filter, FuzzyMode fuzzy )
|
||||
public Collection<IAEFluidStack> findFuzzy( final IAEFluidStack filter, final FuzzyMode fuzzy )
|
||||
{
|
||||
if( filter == null )
|
||||
{
|
||||
@@ -85,7 +85,7 @@ public final class FluidList implements IItemList<IAEFluidStack>
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addStorage( IAEFluidStack option )
|
||||
public void addStorage( final IAEFluidStack option )
|
||||
{
|
||||
if( option == null )
|
||||
{
|
||||
@@ -111,7 +111,7 @@ public final class FluidList implements IItemList<IAEFluidStack>
|
||||
*/
|
||||
|
||||
@Override
|
||||
public void addCrafting( IAEFluidStack option )
|
||||
public void addCrafting( final IAEFluidStack option )
|
||||
{
|
||||
if( option == null )
|
||||
{
|
||||
@@ -134,7 +134,7 @@ public final class FluidList implements IItemList<IAEFluidStack>
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addRequestable( IAEFluidStack option )
|
||||
public void addRequestable( final IAEFluidStack option )
|
||||
{
|
||||
if( option == null )
|
||||
{
|
||||
@@ -160,7 +160,7 @@ public final class FluidList implements IItemList<IAEFluidStack>
|
||||
@Override
|
||||
public IAEFluidStack getFirstItem()
|
||||
{
|
||||
for( IAEFluidStack stackType : this )
|
||||
for( final IAEFluidStack stackType : this )
|
||||
{
|
||||
return stackType;
|
||||
}
|
||||
@@ -183,18 +183,18 @@ public final class FluidList implements IItemList<IAEFluidStack>
|
||||
@Override
|
||||
public void resetStatus()
|
||||
{
|
||||
for( IAEFluidStack i : this )
|
||||
for( final IAEFluidStack i : this )
|
||||
{
|
||||
i.reset();
|
||||
}
|
||||
}
|
||||
|
||||
private IAEFluidStack getFluidRecord( IAEFluidStack fluid )
|
||||
private IAEFluidStack getFluidRecord( final IAEFluidStack fluid )
|
||||
{
|
||||
return this.records.get( fluid );
|
||||
}
|
||||
|
||||
private IAEFluidStack putFluidRecord( IAEFluidStack fluid )
|
||||
private IAEFluidStack putFluidRecord( final IAEFluidStack fluid )
|
||||
{
|
||||
return this.records.put( fluid, fluid );
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ public final class ItemList implements IItemList<IAEItemStack>
|
||||
private final Map<Item, NavigableMap<IAEItemStack, IAEItemStack>> records = new IdentityHashMap<Item, NavigableMap<IAEItemStack, IAEItemStack>>();
|
||||
|
||||
@Override
|
||||
public void add( IAEItemStack option )
|
||||
public void add( final IAEItemStack option )
|
||||
{
|
||||
if( option == null )
|
||||
{
|
||||
@@ -64,7 +64,7 @@ public final class ItemList implements IItemList<IAEItemStack>
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAEItemStack findPrecise( IAEItemStack itemStack )
|
||||
public IAEItemStack findPrecise( final IAEItemStack itemStack )
|
||||
{
|
||||
if( itemStack == null )
|
||||
{
|
||||
@@ -75,7 +75,7 @@ public final class ItemList implements IItemList<IAEItemStack>
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<IAEItemStack> findFuzzy( IAEItemStack filter, FuzzyMode fuzzy )
|
||||
public Collection<IAEItemStack> findFuzzy( final IAEItemStack filter, final FuzzyMode fuzzy )
|
||||
{
|
||||
if( filter == null )
|
||||
{
|
||||
@@ -98,7 +98,7 @@ public final class ItemList implements IItemList<IAEItemStack>
|
||||
{
|
||||
final Collection<IAEItemStack> output = new LinkedList<IAEItemStack>();
|
||||
|
||||
for( IAEItemStack is : or.getAEEquivalents() )
|
||||
for( final IAEItemStack is : or.getAEEquivalents() )
|
||||
{
|
||||
output.addAll( this.findFuzzyDamage( (AEItemStack) is, fuzzy, is.getItemDamage() == OreDictionary.WILDCARD_VALUE ) );
|
||||
}
|
||||
@@ -117,7 +117,7 @@ public final class ItemList implements IItemList<IAEItemStack>
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addStorage( IAEItemStack option )
|
||||
public void addStorage( final IAEItemStack option )
|
||||
{
|
||||
if( option == null )
|
||||
{
|
||||
@@ -143,7 +143,7 @@ public final class ItemList implements IItemList<IAEItemStack>
|
||||
*/
|
||||
|
||||
@Override
|
||||
public void addCrafting( IAEItemStack option )
|
||||
public void addCrafting( final IAEItemStack option )
|
||||
{
|
||||
if( option == null )
|
||||
{
|
||||
@@ -166,7 +166,7 @@ public final class ItemList implements IItemList<IAEItemStack>
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addRequestable( IAEItemStack option )
|
||||
public void addRequestable( final IAEItemStack option )
|
||||
{
|
||||
if( option == null )
|
||||
{
|
||||
@@ -192,7 +192,7 @@ public final class ItemList implements IItemList<IAEItemStack>
|
||||
@Override
|
||||
public IAEItemStack getFirstItem()
|
||||
{
|
||||
for( IAEItemStack stackType : this )
|
||||
for( final IAEItemStack stackType : this )
|
||||
{
|
||||
return stackType;
|
||||
}
|
||||
@@ -205,7 +205,7 @@ public final class ItemList implements IItemList<IAEItemStack>
|
||||
{
|
||||
int size = 0;
|
||||
|
||||
for( Map<IAEItemStack, IAEItemStack> element : this.records.values() )
|
||||
for( final Map<IAEItemStack, IAEItemStack> element : this.records.values() )
|
||||
{
|
||||
size += element.size();
|
||||
}
|
||||
@@ -222,13 +222,13 @@ public final class ItemList implements IItemList<IAEItemStack>
|
||||
@Override
|
||||
public void resetStatus()
|
||||
{
|
||||
for( IAEItemStack i : this )
|
||||
for( final IAEItemStack i : this )
|
||||
{
|
||||
i.reset();
|
||||
}
|
||||
}
|
||||
|
||||
private NavigableMap<IAEItemStack, IAEItemStack> getItemRecord( Item item )
|
||||
private NavigableMap<IAEItemStack, IAEItemStack> getItemRecord( final Item item )
|
||||
{
|
||||
NavigableMap<IAEItemStack, IAEItemStack> itemRecords = this.records.get( item );
|
||||
|
||||
@@ -241,12 +241,12 @@ public final class ItemList implements IItemList<IAEItemStack>
|
||||
return itemRecords;
|
||||
}
|
||||
|
||||
private IAEItemStack putItemRecord( IAEItemStack itemStack )
|
||||
private IAEItemStack putItemRecord( final IAEItemStack itemStack )
|
||||
{
|
||||
return this.getItemRecord( itemStack.getItem() ).put( itemStack, itemStack );
|
||||
}
|
||||
|
||||
private Collection<IAEItemStack> findFuzzyDamage( AEItemStack filter, FuzzyMode fuzzy, boolean ignoreMeta )
|
||||
private Collection<IAEItemStack> findFuzzyDamage( final AEItemStack filter, final FuzzyMode fuzzy, final boolean ignoreMeta )
|
||||
{
|
||||
final IAEItemStack low = filter.getLow( fuzzy, ignoreMeta );
|
||||
final IAEItemStack high = filter.getHigh( fuzzy, ignoreMeta );
|
||||
|
||||
@@ -33,13 +33,13 @@ public class ItemModList implements IItemContainer<IAEItemStack>
|
||||
final IItemContainer<IAEItemStack> backingStore;
|
||||
final IItemContainer<IAEItemStack> overrides = AEApi.instance().storage().createItemList();
|
||||
|
||||
public ItemModList( IItemContainer<IAEItemStack> backend )
|
||||
public ItemModList( final IItemContainer<IAEItemStack> backend )
|
||||
{
|
||||
this.backingStore = backend;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void add( IAEItemStack option )
|
||||
public void add( final IAEItemStack option )
|
||||
{
|
||||
IAEItemStack over = this.overrides.findPrecise( option );
|
||||
if( over == null )
|
||||
@@ -62,9 +62,9 @@ public class ItemModList implements IItemContainer<IAEItemStack>
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAEItemStack findPrecise( IAEItemStack i )
|
||||
public IAEItemStack findPrecise( final IAEItemStack i )
|
||||
{
|
||||
IAEItemStack over = this.overrides.findPrecise( i );
|
||||
final IAEItemStack over = this.overrides.findPrecise( i );
|
||||
if( over == null )
|
||||
{
|
||||
return this.backingStore.findPrecise( i );
|
||||
@@ -73,7 +73,7 @@ public class ItemModList implements IItemContainer<IAEItemStack>
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<IAEItemStack> findFuzzy( IAEItemStack input, FuzzyMode fuzzy )
|
||||
public Collection<IAEItemStack> findFuzzy( final IAEItemStack input, final FuzzyMode fuzzy )
|
||||
{
|
||||
return this.overrides.findFuzzy( input, fuzzy );
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ public class MeaningfulFluidIterator<T extends IAEStack> implements Iterator<T>
|
||||
private final Iterator<T> parent;
|
||||
private T next;
|
||||
|
||||
public MeaningfulFluidIterator( Iterator<T> iterator )
|
||||
public MeaningfulFluidIterator( final Iterator<T> iterator )
|
||||
{
|
||||
this.parent = iterator;
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ public class MeaningfulItemIterator<T extends IAEItemStack> implements Iterator<
|
||||
private Iterator<T> innerIterater = null;
|
||||
private T next;
|
||||
|
||||
public MeaningfulItemIterator( Iterator<NavigableMap<T, T>> iterator )
|
||||
public MeaningfulItemIterator( final Iterator<NavigableMap<T, T>> iterator )
|
||||
{
|
||||
this.parent = iterator;
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ public class OreHelper
|
||||
private final LoadingCache<String, List<ItemStack>> oreDictCache = CacheBuilder.newBuilder().build( new CacheLoader<String, List<ItemStack>>()
|
||||
{
|
||||
@Override
|
||||
public List<ItemStack> load( String oreName )
|
||||
public List<ItemStack> load( final String oreName )
|
||||
{
|
||||
return OreDictionary.getOres( oreName );
|
||||
}
|
||||
@@ -62,9 +62,9 @@ public class OreHelper
|
||||
*
|
||||
* @return true if an ore entry exists, false otherwise
|
||||
*/
|
||||
public OreReference isOre( ItemStack itemStack )
|
||||
public OreReference isOre( final ItemStack itemStack )
|
||||
{
|
||||
ItemRef ir = new ItemRef( itemStack );
|
||||
final ItemRef ir = new ItemRef( itemStack );
|
||||
|
||||
if( !this.references.containsKey( ir ) )
|
||||
{
|
||||
@@ -72,9 +72,9 @@ public class OreHelper
|
||||
final Collection<Integer> ores = ref.getOres();
|
||||
final Collection<String> set = ref.getEquivalents();
|
||||
|
||||
Set<String> toAdd = new HashSet<String>();
|
||||
final Set<String> toAdd = new HashSet<String>();
|
||||
|
||||
for( String ore : OreDictionary.getOreNames() )
|
||||
for( final String ore : OreDictionary.getOreNames() )
|
||||
{
|
||||
// skip ore if it is a match already or null.
|
||||
if( ore == null || toAdd.contains( ore ) )
|
||||
@@ -82,7 +82,7 @@ public class OreHelper
|
||||
continue;
|
||||
}
|
||||
|
||||
for( ItemStack oreItem : this.oreDictCache.getUnchecked( ore ) )
|
||||
for( final ItemStack oreItem : this.oreDictCache.getUnchecked( ore ) )
|
||||
{
|
||||
if( OreDictionary.itemMatches( oreItem, itemStack, false ) )
|
||||
{
|
||||
@@ -92,7 +92,7 @@ public class OreHelper
|
||||
}
|
||||
}
|
||||
|
||||
for( String ore : toAdd )
|
||||
for( final String ore : toAdd )
|
||||
{
|
||||
set.add( ore );
|
||||
ores.add( OreDictionary.getOreID( ore ) );
|
||||
@@ -111,15 +111,15 @@ public class OreHelper
|
||||
return this.references.get( ir );
|
||||
}
|
||||
|
||||
public boolean sameOre( AEItemStack aeItemStack, IAEItemStack is )
|
||||
public boolean sameOre( final AEItemStack aeItemStack, final IAEItemStack is )
|
||||
{
|
||||
OreReference a = aeItemStack.def.isOre;
|
||||
OreReference b = aeItemStack.def.isOre;
|
||||
final OreReference a = aeItemStack.def.isOre;
|
||||
final OreReference b = aeItemStack.def.isOre;
|
||||
|
||||
return this.sameOre( a, b );
|
||||
}
|
||||
|
||||
public boolean sameOre( OreReference a, OreReference b )
|
||||
public boolean sameOre( final OreReference a, final OreReference b )
|
||||
{
|
||||
if( a == null || b == null )
|
||||
{
|
||||
@@ -131,8 +131,8 @@ public class OreHelper
|
||||
return true;
|
||||
}
|
||||
|
||||
Collection<Integer> bOres = b.getOres();
|
||||
for( Integer ore : a.getOres() )
|
||||
final Collection<Integer> bOres = b.getOres();
|
||||
for( final Integer ore : a.getOres() )
|
||||
{
|
||||
if( bOres.contains( ore ) )
|
||||
{
|
||||
@@ -143,17 +143,17 @@ public class OreHelper
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean sameOre( AEItemStack aeItemStack, ItemStack o )
|
||||
public boolean sameOre( final AEItemStack aeItemStack, final ItemStack o )
|
||||
{
|
||||
OreReference a = aeItemStack.def.isOre;
|
||||
final OreReference a = aeItemStack.def.isOre;
|
||||
if( a == null )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
for( String oreName : a.getEquivalents() )
|
||||
for( final String oreName : a.getEquivalents() )
|
||||
{
|
||||
for( ItemStack oreItem : this.oreDictCache.getUnchecked( oreName ) )
|
||||
for( final ItemStack oreItem : this.oreDictCache.getUnchecked( oreName ) )
|
||||
{
|
||||
if( OreDictionary.itemMatches( oreItem, o, false ) )
|
||||
{
|
||||
@@ -165,7 +165,7 @@ public class OreHelper
|
||||
return false;
|
||||
}
|
||||
|
||||
public List<ItemStack> getCachedOres( String oreName )
|
||||
public List<ItemStack> getCachedOres( final String oreName )
|
||||
{
|
||||
return this.oreDictCache.getUnchecked( oreName );
|
||||
}
|
||||
@@ -177,7 +177,7 @@ public class OreHelper
|
||||
private final int damage;
|
||||
private final int hash;
|
||||
|
||||
ItemRef( ItemStack stack )
|
||||
ItemRef( final ItemStack stack )
|
||||
{
|
||||
this.ref = stack.getItem();
|
||||
|
||||
@@ -200,7 +200,7 @@ public class OreHelper
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals( Object obj )
|
||||
public boolean equals( final Object obj )
|
||||
{
|
||||
if( obj == null )
|
||||
{
|
||||
@@ -210,7 +210,7 @@ public class OreHelper
|
||||
{
|
||||
return false;
|
||||
}
|
||||
ItemRef other = (ItemRef) obj;
|
||||
final ItemRef other = (ItemRef) obj;
|
||||
return this.damage == other.damage && this.ref == other.ref;
|
||||
}
|
||||
|
||||
|
||||
@@ -49,9 +49,9 @@ public class OreReference
|
||||
this.aeOtherOptions = new ArrayList<IAEItemStack>( this.otherOptions.size() );
|
||||
|
||||
// SUMMON AE STACKS!
|
||||
for( String oreName : this.otherOptions )
|
||||
for( final String oreName : this.otherOptions )
|
||||
{
|
||||
for( ItemStack is : OreHelper.INSTANCE.getCachedOres( oreName ) )
|
||||
for( final ItemStack is : OreHelper.INSTANCE.getCachedOres( oreName ) )
|
||||
{
|
||||
if( is.getItem() != null )
|
||||
{
|
||||
|
||||
@@ -32,7 +32,7 @@ public class SharedSearchObject
|
||||
public AESharedNBT shared;
|
||||
NBTTagCompound compound;
|
||||
|
||||
public SharedSearchObject( Item itemID, int damageValue, NBTTagCompound tagCompound )
|
||||
public SharedSearchObject( final Item itemID, final int damageValue, final NBTTagCompound tagCompound )
|
||||
{
|
||||
this.def = ( damageValue << Platform.DEF_OFFSET ) | Item.itemRegistry.getIDForObject( itemID );
|
||||
this.hash = Platform.NBTOrderlessHash( tagCompound );
|
||||
@@ -46,7 +46,7 @@ public class SharedSearchObject
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals( Object obj )
|
||||
public boolean equals( final Object obj )
|
||||
{
|
||||
if( obj == null )
|
||||
{
|
||||
@@ -56,7 +56,7 @@ public class SharedSearchObject
|
||||
{
|
||||
return false;
|
||||
}
|
||||
SharedSearchObject other = (SharedSearchObject) obj;
|
||||
final SharedSearchObject other = (SharedSearchObject) obj;
|
||||
if( this.def == other.def && this.hash == other.hash )
|
||||
{
|
||||
return Platform.NBTEqualityTest( this.compound, other.compound );
|
||||
|
||||
@@ -32,7 +32,7 @@ public final class AEInvIterator implements Iterator<IAEItemStack>
|
||||
|
||||
private int counter = 0;
|
||||
|
||||
public AEInvIterator( AppEngInternalAEInventory inventory )
|
||||
public AEInvIterator( final AppEngInternalAEInventory inventory )
|
||||
{
|
||||
this.inventory = inventory;
|
||||
this.size = this.inventory.getSizeInventory();
|
||||
|
||||
@@ -28,7 +28,7 @@ public final class ChainedIterator<T> implements Iterator<T>
|
||||
|
||||
private int offset = 0;
|
||||
|
||||
public ChainedIterator( T... list )
|
||||
public ChainedIterator( final T... list )
|
||||
{
|
||||
this.list = list;
|
||||
}
|
||||
@@ -42,7 +42,7 @@ public final class ChainedIterator<T> implements Iterator<T>
|
||||
@Override
|
||||
public T next()
|
||||
{
|
||||
T result = this.list[this.offset];
|
||||
final T result = this.list[this.offset];
|
||||
this.offset++;
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ public final class InvIterator implements Iterator<ItemStack>
|
||||
|
||||
private int counter = 0;
|
||||
|
||||
public InvIterator( IInventory inventory )
|
||||
public InvIterator( final IInventory inventory )
|
||||
{
|
||||
this.inventory = inventory;
|
||||
this.size = this.inventory.getSizeInventory();
|
||||
@@ -47,7 +47,7 @@ public final class InvIterator implements Iterator<ItemStack>
|
||||
@Override
|
||||
public ItemStack next()
|
||||
{
|
||||
ItemStack result = this.inventory.getStackInSlot( this.counter );
|
||||
final ItemStack result = this.inventory.getStackInSlot( this.counter );
|
||||
this.counter++;
|
||||
|
||||
return result;
|
||||
|
||||
@@ -30,7 +30,7 @@ public final class ProxyNodeIterator implements Iterator<IGridNode>
|
||||
{
|
||||
private final Iterator<IGridHost> hosts;
|
||||
|
||||
public ProxyNodeIterator( Iterator<IGridHost> hosts )
|
||||
public ProxyNodeIterator( final Iterator<IGridHost> hosts )
|
||||
{
|
||||
this.hosts = hosts;
|
||||
}
|
||||
@@ -44,7 +44,7 @@ public final class ProxyNodeIterator implements Iterator<IGridNode>
|
||||
@Override
|
||||
public IGridNode next()
|
||||
{
|
||||
IGridHost host = this.hosts.next();
|
||||
final IGridHost host = this.hosts.next();
|
||||
return host.getGridNode( AEPartLocation.INTERNAL );
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ public class StackToSlotIterator implements Iterator<ItemSlot>
|
||||
final Iterator<ItemStack> is;
|
||||
int x = 0;
|
||||
|
||||
public StackToSlotIterator( Iterator<ItemStack> is )
|
||||
public StackToSlotIterator( final Iterator<ItemStack> is )
|
||||
{
|
||||
this.is = is;
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ public class DefaultPriorityList<T extends IAEStack<T>> implements IPartitionLis
|
||||
static final List NULL_LIST = new ArrayList();
|
||||
|
||||
@Override
|
||||
public boolean isListed( T input )
|
||||
public boolean isListed( final T input )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -32,16 +32,16 @@ public class FuzzyPriorityList<T extends IAEStack<T>> implements IPartitionList<
|
||||
final IItemList<T> list;
|
||||
final FuzzyMode mode;
|
||||
|
||||
public FuzzyPriorityList( IItemList<T> in, FuzzyMode mode )
|
||||
public FuzzyPriorityList( final IItemList<T> in, final FuzzyMode mode )
|
||||
{
|
||||
this.list = in;
|
||||
this.mode = mode;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isListed( T input )
|
||||
public boolean isListed( final T input )
|
||||
{
|
||||
Collection<T> out = this.list.findFuzzy( input, this.mode );
|
||||
final Collection<T> out = this.list.findFuzzy( input, this.mode );
|
||||
return out != null && !out.isEmpty();
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ public final class MergedPriorityList<T extends IAEStack<T>> implements IPartiti
|
||||
private final Collection<IPartitionList<T>> positive = new ArrayList<IPartitionList<T>>();
|
||||
private final Collection<IPartitionList<T>> negative = new ArrayList<IPartitionList<T>>();
|
||||
|
||||
public void addNewList( IPartitionList<T> list, boolean isWhitelist )
|
||||
public void addNewList( final IPartitionList<T> list, final boolean isWhitelist )
|
||||
{
|
||||
if( isWhitelist )
|
||||
{
|
||||
@@ -44,9 +44,9 @@ public final class MergedPriorityList<T extends IAEStack<T>> implements IPartiti
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isListed( T input )
|
||||
public boolean isListed( final T input )
|
||||
{
|
||||
for( IPartitionList<T> l : this.negative )
|
||||
for( final IPartitionList<T> l : this.negative )
|
||||
{
|
||||
if( l.isListed( input ) )
|
||||
{
|
||||
@@ -56,7 +56,7 @@ public final class MergedPriorityList<T extends IAEStack<T>> implements IPartiti
|
||||
|
||||
if( !this.positive.isEmpty() )
|
||||
{
|
||||
for( IPartitionList<T> l : this.positive )
|
||||
for( final IPartitionList<T> l : this.positive )
|
||||
{
|
||||
if( l.isListed( input ) )
|
||||
{
|
||||
|
||||
@@ -28,13 +28,13 @@ public class PrecisePriorityList<T extends IAEStack<T>> implements IPartitionLis
|
||||
|
||||
final IItemList<T> list;
|
||||
|
||||
public PrecisePriorityList( IItemList<T> in )
|
||||
public PrecisePriorityList( final IItemList<T> in )
|
||||
{
|
||||
this.list = in;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isListed( T input )
|
||||
public boolean isListed( final T input )
|
||||
{
|
||||
return this.list.findPrecise( input ) != null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user