Changed access to use this qualifier

This commit is contained in:
yueh
2014-12-29 15:13:47 +01:00
parent 2a5e57a59b
commit f471513bd0
604 changed files with 11573 additions and 11573 deletions
+2 -2
View File
@@ -38,8 +38,8 @@ public class BlockUpdate implements Callable
@Override
public Object call() throws Exception
{
if ( w.blockExists( x, y, z ) )
w.notifyBlocksOfNeighborChange( x, y, z, Platform.air );
if ( this.w.blockExists( this.x, this.y, this.z ) )
this.w.notifyBlocksOfNeighborChange( this.x, this.y, this.z, Platform.air );
return true;
}
@@ -46,14 +46,14 @@ public class ClassInstantiation<T>
for ( Constructor<T> constructor : constructors )
{
Class<?>[] paramTypes = constructor.getParameterTypes();
if ( paramTypes.length == args.length )
if ( paramTypes.length == this.args.length )
{
boolean valid = true;
for ( int idx = 0; idx < paramTypes.length; idx++ )
{
Class<?> cz = args[idx].getClass();
if ( !isClassMatch( paramTypes[idx], cz, args[idx] ) )
Class<?> cz = this.args[idx].getClass();
if ( !this.isClassMatch( paramTypes[idx], cz, this.args[idx] ) )
valid = false;
}
@@ -61,7 +61,7 @@ public class ClassInstantiation<T>
{
try
{
return Optional.of( constructor.newInstance( args ) );
return Optional.of( constructor.newInstance( this.args ) );
}
catch ( InstantiationException e )
{
@@ -88,8 +88,8 @@ public class ClassInstantiation<T>
if ( value == null && !expected.isPrimitive() )
return true;
expected = condense( expected, Boolean.class, Character.class, Byte.class, Short.class, Integer.class, Long.class, Float.class, Double.class );
got = condense( got, Boolean.class, Character.class, Byte.class, Short.class, Integer.class, Long.class, Float.class, Double.class );
expected = this.condense( expected, Boolean.class, Character.class, Byte.class, Short.class, Integer.class, Long.class, Float.class, Double.class );
got = this.condense( got, Boolean.class, Character.class, Byte.class, Short.class, Integer.class, Long.class, Float.class, Double.class );
return expected == got || expected.isAssignableFrom( got );
}
+12 -12
View File
@@ -34,7 +34,7 @@ public class ConfigManager implements IConfigManager
final IConfigManagerHost target;
public ConfigManager(IConfigManagerHost tile) {
target = tile;
this.target = tile;
}
/**
@@ -45,7 +45,7 @@ public class ConfigManager implements IConfigManager
@Override
public void readFromNBT(NBTTagCompound tagCompound)
{
for (Enum key : Settings.keySet())
for (Enum key : this.Settings.keySet())
{
try
{
@@ -60,11 +60,11 @@ public class ConfigManager implements IConfigManager
value = LevelEmitterMode.STORABLE_AMOUNT.toString();
}
Enum oldValue = Settings.get( key );
Enum oldValue = this.Settings.get( key );
Enum newValue = Enum.valueOf( oldValue.getClass(), value );
putSetting( key, newValue );
this.putSetting( key, newValue );
}
}
catch (IllegalArgumentException e)
@@ -83,9 +83,9 @@ public class ConfigManager implements IConfigManager
public void writeToNBT(NBTTagCompound tagCompound)
{
for (Enum e : Settings.keySet())
for (Enum e : this.Settings.keySet())
{
tagCompound.setString( e.name(), Settings.get( e ).toString() );
tagCompound.setString( e.name(), this.Settings.get( e ).toString() );
}
}
@@ -93,19 +93,19 @@ public class ConfigManager implements IConfigManager
@Override
public Set<Enum> getSettings()
{
return Settings.keySet();
return this.Settings.keySet();
}
@Override
public void registerSetting(Enum settingName, Enum defaultValue)
{
Settings.put( settingName, defaultValue );
this.Settings.put( settingName, defaultValue );
}
@Override
public Enum getSetting(Enum settingName)
{
Enum oldValue = Settings.get( settingName );
Enum oldValue = this.Settings.get( settingName );
if ( oldValue != null )
return oldValue;
@@ -116,9 +116,9 @@ public class ConfigManager implements IConfigManager
@Override
public Enum putSetting(Enum settingName, Enum newValue)
{
Enum oldValue = getSetting( settingName );
Settings.put( settingName, newValue );
target.updateSetting( this, settingName, newValue );
Enum oldValue = this.getSetting( settingName );
this.Settings.put( settingName, newValue );
this.target.updateSetting( this, settingName, newValue );
return oldValue;
}
@@ -56,17 +56,17 @@ public class InWorldToolOperationResult
}
public InWorldToolOperationResult() {
BlockItem = null;
Drops = null;
this.BlockItem = null;
this.Drops = null;
}
public InWorldToolOperationResult(ItemStack block, List<ItemStack> drops) {
BlockItem = block;
Drops = drops;
this.BlockItem = block;
this.Drops = drops;
}
public InWorldToolOperationResult(ItemStack block) {
BlockItem = block;
Drops = null;
this.BlockItem = block;
this.Drops = null;
}
}
+2 -2
View File
@@ -91,8 +91,8 @@ public class ItemSorters
AEItemStack op2 = (AEItemStack) o2;
if ( Direction == SortDir.ASCENDING )
return secondarySort( op2.getModID().compareToIgnoreCase( op1.getModID() ), o1, o2 );
return secondarySort( op1.getModID().compareToIgnoreCase( op2.getModID() ), o2, o1 );
return this.secondarySort( op2.getModID().compareToIgnoreCase( op1.getModID() ), o1, o2 );
return this.secondarySort( op1.getModID().compareToIgnoreCase( op2.getModID() ), o2, o1 );
}
private int secondarySort(int compareToIgnoreCase, IAEItemStack o1, IAEItemStack o2)
@@ -29,31 +29,31 @@ public class ReadOnlyCollection<T> implements IReadOnlyCollection<T>
private final Collection<T> c;
public ReadOnlyCollection(Collection<T> in) {
c = in;
this.c = in;
}
@Override
public Iterator<T> iterator()
{
return c.iterator();
return this.c.iterator();
}
@Override
public int size()
{
return c.size();
return this.c.size();
}
@Override
public boolean isEmpty()
{
return c.isEmpty();
return this.c.isEmpty();
}
@Override
public boolean contains(Object node)
{
return c.contains( node );
return this.c.contains( node );
}
}
@@ -38,18 +38,18 @@ public class AdaptorBCPipe extends InventoryAdaptor
final private ForgeDirection d;
public AdaptorBCPipe(TileEntity s, ForgeDirection dd) {
bc = (IBC) AppEng.instance.getIntegration( IntegrationType.BC );
if ( bc != null )
this.bc = (IBC) AppEng.instance.getIntegration( IntegrationType.BC );
if ( this.bc != null )
{
if ( bc.isPipe( s, dd ) )
if ( this.bc.isPipe( s, dd ) )
{
i = s;
d = dd;
this.i = s;
this.d = dd;
return;
}
}
i = null;
d = null;
this.i = null;
this.d = null;
}
@Override
@@ -79,14 +79,14 @@ public class AdaptorBCPipe extends InventoryAdaptor
@Override
public ItemStack addItems(ItemStack A)
{
if ( i == null )
if ( this.i == null )
return A;
if ( A == null )
return null;
if ( A.stackSize == 0 )
return null;
if ( bc.addItemsToPipe( i, A, d ) )
if ( this.bc.addItemsToPipe( this.i, A, this.d ) )
return null;
return A;
}
@@ -94,7 +94,7 @@ public class AdaptorBCPipe extends InventoryAdaptor
@Override
public ItemStack simulateAdd(ItemStack A)
{
if ( i == null )
if ( this.i == null )
return A;
return null;
}
@@ -36,24 +36,24 @@ public class AdaptorIInventory extends InventoryAdaptor
public AdaptorIInventory( IInventory s )
{
i = s;
wrapperEnabled = s instanceof IInventoryWrapper;
this.i = s;
this.wrapperEnabled = s instanceof IInventoryWrapper;
}
boolean canRemoveStackFromSlot( int x, ItemStack is )
{
if ( wrapperEnabled )
return ( ( IInventoryWrapper ) i ).canRemoveItemFromSlot( x, is );
if ( this.wrapperEnabled )
return ( ( IInventoryWrapper ) this.i ).canRemoveItemFromSlot( x, is );
return true;
}
@Override
public boolean containsItems()
{
int s = i.getSizeInventory();
int s = this.i.getSizeInventory();
for ( int x = 0; x < s; x++ )
{
if ( i.getStackInSlot( x ) != null )
if ( this.i.getStackInSlot( x ) != null )
return true;
}
return false;
@@ -62,11 +62,11 @@ public class AdaptorIInventory extends InventoryAdaptor
@Override
public ItemStack removeSimilarItems( int amount, ItemStack filter, FuzzyMode fuzzyMode, IInventoryDestination destination )
{
int s = i.getSizeInventory();
int s = this.i.getSizeInventory();
for ( int x = 0; x < s; x++ )
{
ItemStack is = i.getStackInSlot( x );
if ( is != null && canRemoveStackFromSlot( x, is ) && ( filter == null || Platform.isSameItemFuzzy( is, filter, fuzzyMode ) ) )
ItemStack is = this.i.getStackInSlot( x );
if ( is != null && this.canRemoveStackFromSlot( x, is ) && ( filter == null || Platform.isSameItemFuzzy( is, filter, fuzzyMode ) ) )
{
int newAmount = amount;
if ( newAmount > is.stackSize )
@@ -82,15 +82,15 @@ public class AdaptorIInventory extends InventoryAdaptor
if ( is.stackSize == rv.stackSize )
{
i.setInventorySlotContents( x, null );
i.markDirty();
this.i.setInventorySlotContents( x, null );
this.i.markDirty();
}
else
{
ItemStack po = is.copy();
po.stackSize -= rv.stackSize;
i.setInventorySlotContents( x, po );
i.markDirty();
this.i.setInventorySlotContents( x, po );
this.i.markDirty();
}
}
@@ -107,12 +107,12 @@ public class AdaptorIInventory extends InventoryAdaptor
@Override
public ItemStack simulateSimilarRemove( int amount, ItemStack filter, FuzzyMode fuzzyMode, IInventoryDestination destination )
{
int s = i.getSizeInventory();
int s = this.i.getSizeInventory();
for ( int x = 0; x < s; x++ )
{
ItemStack is = i.getStackInSlot( x );
ItemStack is = this.i.getStackInSlot( x );
if ( is != null && canRemoveStackFromSlot( x, is ) && ( filter == null || Platform.isSameItemFuzzy( is, filter, fuzzyMode ) ) )
if ( is != null && this.canRemoveStackFromSlot( x, is ) && ( filter == null || Platform.isSameItemFuzzy( is, filter, fuzzyMode ) ) )
{
int boundAmount = amount;
if ( boundAmount > is.stackSize )
@@ -134,13 +134,13 @@ public class AdaptorIInventory extends InventoryAdaptor
@Override
public ItemStack removeItems( int amount, ItemStack filter, IInventoryDestination destination )
{
int s = i.getSizeInventory();
int s = this.i.getSizeInventory();
ItemStack rv = null;
for ( int x = 0; x < s && amount > 0; x++ )
{
ItemStack is = i.getStackInSlot( x );
if ( is != null && canRemoveStackFromSlot( x, is ) && ( filter == null || Platform.isSameItemPrecise( is, filter ) ) )
ItemStack is = this.i.getStackInSlot( x );
if ( is != null && this.canRemoveStackFromSlot( x, is ) && ( filter == null || Platform.isSameItemPrecise( is, filter ) ) )
{
int boundAmounts = amount;
if ( boundAmounts > is.stackSize )
@@ -165,15 +165,15 @@ public class AdaptorIInventory extends InventoryAdaptor
if ( is.stackSize == boundAmounts )
{
i.setInventorySlotContents( x, null );
i.markDirty();
this.i.setInventorySlotContents( x, null );
this.i.markDirty();
}
else
{
ItemStack po = is.copy();
po.stackSize -= boundAmounts;
i.setInventorySlotContents( x, po );
i.markDirty();
this.i.setInventorySlotContents( x, po );
this.i.markDirty();
}
}
}
@@ -188,13 +188,13 @@ public class AdaptorIInventory extends InventoryAdaptor
@Override
public ItemStack simulateRemove( int amount, ItemStack filter, IInventoryDestination destination )
{
int s = i.getSizeInventory();
int s = this.i.getSizeInventory();
ItemStack rv = null;
for ( int x = 0; x < s && amount > 0; x++ )
{
ItemStack is = i.getStackInSlot( x );
if ( is != null && canRemoveStackFromSlot( x, is ) && ( filter == null || Platform.isSameItemPrecise( is, filter ) ) )
ItemStack is = this.i.getStackInSlot( x );
if ( is != null && this.canRemoveStackFromSlot( x, is ) && ( filter == null || Platform.isSameItemPrecise( is, filter ) ) )
{
int boundAmount = amount;
if ( boundAmount > is.stackSize )
@@ -225,13 +225,13 @@ public class AdaptorIInventory extends InventoryAdaptor
@Override
public ItemStack addItems( ItemStack itemsToAdd )
{
return addItems( itemsToAdd, true );
return this.addItems( itemsToAdd, true );
}
@Override
public ItemStack simulateAdd( ItemStack itemsToAdd )
{
return addItems( itemsToAdd, false );
return this.addItems( itemsToAdd, false );
}
/**
@@ -254,25 +254,25 @@ public class AdaptorIInventory extends InventoryAdaptor
ItemStack left = itemsToAdd.copy();
int stackLimit = itemsToAdd.getMaxStackSize();
int perOperationLimit = Math.min( i.getInventoryStackLimit(), stackLimit );
int inventorySize = i.getSizeInventory();
int perOperationLimit = Math.min( this.i.getInventoryStackLimit(), stackLimit );
int inventorySize = this.i.getSizeInventory();
for ( int slot = 0; slot < inventorySize; slot++ )
{
ItemStack next = left.copy();
next.stackSize = Math.min( perOperationLimit, next.stackSize );
if ( i.isItemValidForSlot( slot, next ) )
if ( this.i.isItemValidForSlot( slot, next ) )
{
ItemStack is = i.getStackInSlot( slot );
ItemStack is = this.i.getStackInSlot( slot );
if ( is == null )
{
left.stackSize -= next.stackSize;
if ( modulate )
{
i.setInventorySlotContents( slot, next );
i.markDirty();
this.i.setInventorySlotContents( slot, next );
this.i.markDirty();
}
if ( left.stackSize <= 0 )
@@ -288,8 +288,8 @@ public class AdaptorIInventory extends InventoryAdaptor
if ( modulate )
{
is.stackSize += used;
i.setInventorySlotContents( slot, is );
i.markDirty();
this.i.setInventorySlotContents( slot, is );
this.i.markDirty();
}
left.stackSize -= used;
@@ -313,19 +313,19 @@ public class AdaptorIInventory extends InventoryAdaptor
@Override
public boolean hasNext()
{
return x < i.getSizeInventory();
return this.x < AdaptorIInventory.this.i.getSizeInventory();
}
@Override
public ItemSlot next()
{
ItemStack iss = i.getStackInSlot( x );
ItemStack iss = AdaptorIInventory.this.i.getStackInSlot( this.x );
is.isExtractable = canRemoveStackFromSlot( x, iss );
is.setItemStack( iss );
this.is.isExtractable = AdaptorIInventory.this.canRemoveStackFromSlot( this.x, iss );
this.is.setItemStack( iss );
is.slot = x++;
return is;
this.is.slot = this.x++;
return this.is;
}
@Override
@@ -36,37 +36,37 @@ public class AdaptorISpecialInventory extends InventoryAdaptor
private final ForgeDirection d;
public AdaptorISpecialInventory(ISpecialInventory s, ForgeDirection dd) {
i = s;
d = dd;
this.i = s;
this.d = dd;
if ( s instanceof ISidedInventory )
remover = new AdaptorIInventory( new WrapperMCISidedInventory( (ISidedInventory) s, d ) );
this.remover = new AdaptorIInventory( new WrapperMCISidedInventory( (ISidedInventory) s, this.d ) );
else
remover = new AdaptorIInventory( s );
this.remover = new AdaptorIInventory( s );
}
@Override
public ItemStack removeSimilarItems(int how_many, ItemStack filter, FuzzyMode fuzzyMode, IInventoryDestination destination)
{
return remover.removeSimilarItems( how_many, filter, fuzzyMode, destination );
return this.remover.removeSimilarItems( how_many, filter, fuzzyMode, destination );
}
@Override
public ItemStack simulateSimilarRemove(int how_many, ItemStack filter, FuzzyMode fuzzyMode, IInventoryDestination destination)
{
return remover.simulateSimilarRemove( how_many, filter, fuzzyMode, destination );
return this.remover.simulateSimilarRemove( how_many, filter, fuzzyMode, destination );
}
@Override
public ItemStack removeItems(int how_many, ItemStack filter, IInventoryDestination destination)
{
return remover.removeItems( how_many, filter, destination );
return this.remover.removeItems( how_many, filter, destination );
}
@Override
public ItemStack simulateRemove(int how_many, ItemStack filter, IInventoryDestination destination)
{
return remover.simulateRemove( how_many, filter, destination );
return this.remover.simulateRemove( how_many, filter, destination );
}
@Override
@@ -77,7 +77,7 @@ public class AdaptorISpecialInventory extends InventoryAdaptor
if ( A.stackSize == 0 )
return null;
int used = i.addItem( A, true, d );
int used = this.i.addItem( A, true, this.d );
ItemStack out = A.copy();
out.stackSize -= used;
if ( out.stackSize > 0 )
@@ -88,7 +88,7 @@ public class AdaptorISpecialInventory extends InventoryAdaptor
@Override
public ItemStack simulateAdd(ItemStack A)
{
int used = i.addItem( A, false, d );
int used = this.i.addItem( A, false, this.d );
ItemStack out = A.copy();
out.stackSize -= used;
if ( out.stackSize > 0 )
@@ -99,17 +99,17 @@ public class AdaptorISpecialInventory extends InventoryAdaptor
@Override
public boolean containsItems()
{
if ( i instanceof ISidedInventory )
if ( this.i instanceof ISidedInventory )
{
ISidedInventory sided = (ISidedInventory) i;
int slots[] = sided.getAccessibleSlotsFromSide( d.ordinal() );
ISidedInventory sided = (ISidedInventory) this.i;
int slots[] = sided.getAccessibleSlotsFromSide( this.d.ordinal() );
if ( slots == null )
return false;
for (int slot : slots)
{
if ( i.getStackInSlot( slot ) != null )
if ( this.i.getStackInSlot( slot ) != null )
{
return true;
}
@@ -118,9 +118,9 @@ public class AdaptorISpecialInventory extends InventoryAdaptor
return false;
}
int s = i.getSizeInventory();
int s = this.i.getSizeInventory();
for (int x = 0; x < s; x++)
if ( i.getStackInSlot( x ) != null )
if ( this.i.getStackInSlot( x ) != null )
return true;
return false;
}
@@ -128,7 +128,7 @@ public class AdaptorISpecialInventory extends InventoryAdaptor
@Override
public Iterator<ItemSlot> iterator()
{
return remover.iterator();
return this.remover.iterator();
}
}
+13 -13
View File
@@ -33,16 +33,16 @@ public class AdaptorList extends InventoryAdaptor
private final List<ItemStack> i;
public AdaptorList(List<ItemStack> s) {
i = s;
this.i = s;
}
@Override
public ItemStack removeSimilarItems(int how_many, ItemStack filter, FuzzyMode fuzzyMode, IInventoryDestination destination)
{
int s = i.size();
int s = this.i.size();
for (int x = 0; x < s; x++)
{
ItemStack is = i.get( x );
ItemStack is = this.i.get( x );
if ( is != null && (filter == null || Platform.isSameItemFuzzy( is, filter, fuzzyMode )) )
{
if ( how_many > is.stackSize )
@@ -58,7 +58,7 @@ public class AdaptorList extends InventoryAdaptor
// remove it..
if ( is.stackSize <= 0 )
i.remove( x );
this.i.remove( x );
return rv;
}
@@ -70,7 +70,7 @@ public class AdaptorList extends InventoryAdaptor
@Override
public ItemStack simulateSimilarRemove(int how_many, ItemStack filter, FuzzyMode fuzzyMode, IInventoryDestination destination)
{
for (ItemStack is : i)
for (ItemStack is : this.i)
{
if ( is != null && (filter == null || Platform.isSameItemFuzzy( is, filter, fuzzyMode )) )
{
@@ -98,10 +98,10 @@ public class AdaptorList extends InventoryAdaptor
@Override
public ItemStack removeItems(int how_many, ItemStack filter, IInventoryDestination destination)
{
int s = i.size();
int s = this.i.size();
for (int x = 0; x < s; x++)
{
ItemStack is = i.get( x );
ItemStack is = this.i.get( x );
if ( is != null && (filter == null || Platform.isSameItemPrecise( is, filter )) )
{
if ( how_many > is.stackSize )
@@ -117,7 +117,7 @@ public class AdaptorList extends InventoryAdaptor
// remove it..
if ( is.stackSize <= 0 )
i.remove( x );
this.i.remove( x );
return rv;
}
@@ -129,7 +129,7 @@ public class AdaptorList extends InventoryAdaptor
@Override
public ItemStack simulateRemove(int how_many, ItemStack filter, IInventoryDestination destination)
{
for (ItemStack is : i)
for (ItemStack is : this.i)
{
if ( is != null && (filter == null || Platform.isSameItemPrecise( is, filter )) )
{
@@ -164,7 +164,7 @@ public class AdaptorList extends InventoryAdaptor
ItemStack left = A.copy();
for (ItemStack is : i)
for (ItemStack is : this.i)
{
if ( Platform.isSameItem( is, left ) )
{
@@ -173,7 +173,7 @@ public class AdaptorList extends InventoryAdaptor
}
}
i.add( left );
this.i.add( left );
return null;
}
@@ -186,7 +186,7 @@ public class AdaptorList extends InventoryAdaptor
@Override
public boolean containsItems()
{
for (ItemStack is : i)
for (ItemStack is : this.i)
{
if ( is != null )
{
@@ -199,7 +199,7 @@ public class AdaptorList extends InventoryAdaptor
@Override
public Iterator<ItemSlot> iterator()
{
return new StackToSlotIterator( i.iterator() );
return new StackToSlotIterator( this.i.iterator() );
}
}
@@ -40,13 +40,13 @@ public class AdaptorPlayerHand extends InventoryAdaptor
public AdaptorPlayerHand( EntityPlayer _p )
{
p = _p;
this.p = _p;
}
@Override
public ItemStack removeSimilarItems( int how_many, ItemStack Filter, FuzzyMode fuzzyMode, IInventoryDestination destination )
{
ItemStack hand = p.inventory.getItemStack();
ItemStack hand = this.p.inventory.getItemStack();
if ( hand == null )
return null;
@@ -56,7 +56,7 @@ public class AdaptorPlayerHand extends InventoryAdaptor
result.stackSize = hand.stackSize > how_many ? how_many : hand.stackSize;
hand.stackSize -= how_many;
if ( hand.stackSize <= 0 )
p.inventory.setItemStack( null );
this.p.inventory.setItemStack( null );
return result;
}
@@ -67,7 +67,7 @@ public class AdaptorPlayerHand extends InventoryAdaptor
public ItemStack simulateSimilarRemove( int how_many, ItemStack Filter, FuzzyMode fuzzyMode, IInventoryDestination destination )
{
ItemStack hand = p.inventory.getItemStack();
ItemStack hand = this.p.inventory.getItemStack();
if ( hand == null )
return null;
@@ -84,7 +84,7 @@ public class AdaptorPlayerHand extends InventoryAdaptor
@Override
public ItemStack removeItems( int how_many, ItemStack Filter, IInventoryDestination destination )
{
ItemStack hand = p.inventory.getItemStack();
ItemStack hand = this.p.inventory.getItemStack();
if ( hand == null )
return null;
@@ -94,7 +94,7 @@ public class AdaptorPlayerHand extends InventoryAdaptor
result.stackSize = hand.stackSize > how_many ? how_many : hand.stackSize;
hand.stackSize -= how_many;
if ( hand.stackSize <= 0 )
p.inventory.setItemStack( null );
this.p.inventory.setItemStack( null );
return result;
}
@@ -105,7 +105,7 @@ public class AdaptorPlayerHand extends InventoryAdaptor
public ItemStack simulateRemove( int how_many, ItemStack Filter, IInventoryDestination destination )
{
ItemStack hand = p.inventory.getItemStack();
ItemStack hand = this.p.inventory.getItemStack();
if ( hand == null )
return null;
@@ -127,12 +127,12 @@ public class AdaptorPlayerHand extends InventoryAdaptor
return null;
if ( A.stackSize == 0 )
return null;
if ( p == null )
if ( this.p == null )
return A;
if ( p.inventory == null )
if ( this.p.inventory == null )
return A;
ItemStack hand = p.inventory.getItemStack();
ItemStack hand = this.p.inventory.getItemStack();
if ( hand != null && !Platform.isSameItemPrecise( A, hand ) )
return A;
@@ -153,18 +153,18 @@ public class AdaptorPlayerHand extends InventoryAdaptor
newHand.stackSize = newHand.getMaxStackSize();
ItemStack B = A.copy();
B.stackSize -= newHand.stackSize - original;
p.inventory.setItemStack( newHand );
this.p.inventory.setItemStack( newHand );
return B;
}
p.inventory.setItemStack( newHand );
this.p.inventory.setItemStack( newHand );
return null;
}
@Override
public ItemStack simulateAdd( ItemStack A )
{
ItemStack hand = p.inventory.getItemStack();
ItemStack hand = this.p.inventory.getItemStack();
if ( A == null )
return null;
@@ -196,7 +196,7 @@ public class AdaptorPlayerHand extends InventoryAdaptor
@Override
public boolean containsItems()
{
return p.inventory.getItemStack() != null;
return this.p.inventory.getItemStack() != null;
}
@Override
+16 -16
View File
@@ -41,19 +41,19 @@ public class IMEAdaptor extends InventoryAdaptor
int maxSlots = 0;
public IMEAdaptor(IMEInventory<IAEItemStack> input, BaseActionSource src) {
target = input;
this.target = input;
this.src = src;
}
IItemList<IAEItemStack> getList()
{
return target.getAvailableItems( AEApi.instance().storage().createItemList() );
return this.target.getAvailableItems( AEApi.instance().storage().createItemList() );
}
@Override
public Iterator<ItemSlot> iterator()
{
return new IMEAdaptorIterator( this, getList() );
return new IMEAdaptorIterator( this, this.getList() );
}
public ItemStack doRemoveItemsFuzzy(int how_many, ItemStack Filter, IInventoryDestination destination, Actionable type, FuzzyMode fuzzyMode)
@@ -64,12 +64,12 @@ public class IMEAdaptor extends InventoryAdaptor
IAEItemStack out = null;
for (IAEItemStack req : ImmutableList.copyOf( getList().findFuzzy( reqFilter, fuzzyMode ) ))
for (IAEItemStack req : ImmutableList.copyOf( this.getList().findFuzzy( reqFilter, fuzzyMode ) ))
{
if ( req != null )
{
req.setStackSize( how_many );
out = target.extractItems( req, type, src );
out = this.target.extractItems( req, type, this.src );
if ( out != null )
return out.getItemStack();
}
@@ -84,7 +84,7 @@ public class IMEAdaptor extends InventoryAdaptor
if ( Filter == null )
{
IItemList<IAEItemStack> list = getList();
IItemList<IAEItemStack> list = this.getList();
if ( !list.isEmpty() )
req = list.getFirstItem();
}
@@ -96,7 +96,7 @@ public class IMEAdaptor extends InventoryAdaptor
if ( req != null )
{
req.setStackSize( how_many );
out = target.extractItems( req, type, src );
out = this.target.extractItems( req, type, this.src );
}
if ( out != null )
@@ -108,29 +108,29 @@ public class IMEAdaptor extends InventoryAdaptor
@Override
public ItemStack removeItems(int how_many, ItemStack Filter, IInventoryDestination destination)
{
return doRemoveItems( how_many, Filter, destination, Actionable.MODULATE );
return this.doRemoveItems( how_many, Filter, destination, Actionable.MODULATE );
}
@Override
public ItemStack simulateRemove(int how_many, ItemStack Filter, IInventoryDestination destination)
{
return doRemoveItems( how_many, Filter, destination, Actionable.SIMULATE );
return this.doRemoveItems( how_many, Filter, destination, Actionable.SIMULATE );
}
@Override
public ItemStack removeSimilarItems(int how_many, ItemStack filter, FuzzyMode fuzzyMode, IInventoryDestination destination)
{
if ( filter == null )
return doRemoveItems( how_many, null, destination, Actionable.MODULATE );
return doRemoveItemsFuzzy( how_many, filter, destination, Actionable.MODULATE, fuzzyMode );
return this.doRemoveItems( how_many, null, destination, Actionable.MODULATE );
return this.doRemoveItemsFuzzy( how_many, filter, destination, Actionable.MODULATE, fuzzyMode );
}
@Override
public ItemStack simulateSimilarRemove(int how_many, ItemStack filter, FuzzyMode fuzzyMode, IInventoryDestination destination)
{
if ( filter == null )
return doRemoveItems( how_many, null, destination, Actionable.SIMULATE );
return doRemoveItemsFuzzy( how_many, filter, destination, Actionable.SIMULATE, fuzzyMode );
return this.doRemoveItems( how_many, null, destination, Actionable.SIMULATE );
return this.doRemoveItemsFuzzy( how_many, filter, destination, Actionable.SIMULATE, fuzzyMode );
}
@Override
@@ -139,7 +139,7 @@ public class IMEAdaptor extends InventoryAdaptor
IAEItemStack in = AEItemStack.create( A );
if ( in != null )
{
IAEItemStack out = target.injectItems( in, Actionable.MODULATE, src );
IAEItemStack out = this.target.injectItems( in, Actionable.MODULATE, this.src );
if ( out != null )
return out.getItemStack();
}
@@ -152,7 +152,7 @@ public class IMEAdaptor extends InventoryAdaptor
IAEItemStack in = AEItemStack.create( A );
if ( in != null )
{
IAEItemStack out = target.injectItems( in, Actionable.SIMULATE, src );
IAEItemStack out = this.target.injectItems( in, Actionable.SIMULATE, this.src );
if ( out != null )
return out.getItemStack();
}
@@ -162,7 +162,7 @@ public class IMEAdaptor extends InventoryAdaptor
@Override
public boolean containsItems()
{
return !getList().isEmpty();
return !this.getList().isEmpty();
}
}
@@ -35,36 +35,36 @@ public class IMEAdaptorIterator implements Iterator<ItemSlot>
final int containerSize;
public IMEAdaptorIterator(IMEAdaptor parent, IItemList<IAEItemStack> availableItems) {
stack = availableItems.iterator();
containerSize = parent.maxSlots;
this.stack = availableItems.iterator();
this.containerSize = parent.maxSlots;
this.parent = parent;
}
@Override
public boolean hasNext()
{
hasNext = stack.hasNext();
return offset < containerSize || hasNext;
this.hasNext = this.stack.hasNext();
return this.offset < this.containerSize || this.hasNext;
}
@Override
public ItemSlot next()
{
slot.slot = offset++;
slot.isExtractable=true;
this.slot.slot = this.offset++;
this.slot.isExtractable=true;
if ( parent.maxSlots < offset )
parent.maxSlots = offset;
if ( this.parent.maxSlots < this.offset )
this.parent.maxSlots = this.offset;
if ( hasNext )
if ( this.hasNext )
{
IAEItemStack item = stack.next();
slot.setAEItemStack( item );
return slot;
IAEItemStack item = this.stack.next();
this.slot.setAEItemStack( item );
return this.slot;
}
slot.setItemStack( null );
return slot;
this.slot.setItemStack( null );
return this.slot;
}
@Override
@@ -30,7 +30,7 @@ public class IMEInventoryDestination implements IInventoryDestination
final IMEInventory<IAEItemStack> me;
public IMEInventoryDestination(IMEInventory<IAEItemStack> o) {
me = o;
this.me = o;
}
@Override
@@ -40,7 +40,7 @@ public class IMEInventoryDestination implements IInventoryDestination
if ( stack == null )
return false;
IAEItemStack failed = me.injectItems( AEItemStack.create( stack ), Actionable.SIMULATE, null );
IAEItemStack failed = this.me.injectItems( AEItemStack.create( stack ), Actionable.SIMULATE, null );
if ( failed == null )
return true;
@@ -31,7 +31,7 @@ public class ItemListIgnoreCrafting<T extends IAEStack> implements IItemList<T>
final IItemList<T> target;
public ItemListIgnoreCrafting(IItemList<T> cla) {
target = cla;
this.target = cla;
}
@Override
@@ -43,7 +43,7 @@ public class ItemListIgnoreCrafting<T extends IAEStack> implements IItemList<T>
option.setCraftable( false );
}
target.add( option );
this.target.add( option );
}
@Override
@@ -55,54 +55,54 @@ public class ItemListIgnoreCrafting<T extends IAEStack> implements IItemList<T>
@Override
public T findPrecise(T i)
{
return target.findPrecise( i );
return this.target.findPrecise( i );
}
@Override
public Collection<T> findFuzzy(T input, FuzzyMode fuzzy)
{
return target.findFuzzy( input, fuzzy );
return this.target.findFuzzy( input, fuzzy );
}
@Override
public boolean isEmpty()
{
return target.isEmpty();
return this.target.isEmpty();
}
@Override
public void addStorage(T option)
{
target.addStorage( option );
this.target.addStorage( option );
}
@Override
public void addRequestable(T option)
{
target.addRequestable( option );
this.target.addRequestable( option );
}
@Override
public T getFirstItem()
{
return target.getFirstItem();
return this.target.getFirstItem();
}
@Override
public int size()
{
return target.size();
return this.target.size();
}
@Override
public Iterator<T> iterator()
{
return target.iterator();
return this.target.iterator();
}
@Override
public void resetStatus()
{
target.resetStatus();
this.target.resetStatus();
}
}
+6 -6
View File
@@ -35,24 +35,24 @@ public class ItemSlot
public void setItemStack(ItemStack is)
{
aeItemStack = null;
itemStack = is;
this.aeItemStack = null;
this.itemStack = is;
}
public void setAEItemStack(IAEItemStack is)
{
aeItemStack = is;
itemStack = null;
this.aeItemStack = is;
this.itemStack = null;
}
public ItemStack getItemStack()
{
return itemStack == null ? (aeItemStack == null ? null : (itemStack = aeItemStack.getItemStack())) : itemStack;
return this.itemStack == null ? (this.aeItemStack == null ? null : (this.itemStack = this.aeItemStack.getItemStack())) : this.itemStack;
}
public IAEItemStack getAEItemStack()
{
return aeItemStack == null ? (itemStack == null ? null : (aeItemStack = AEItemStack.create( itemStack ))) : aeItemStack;
return this.aeItemStack == null ? (this.itemStack == null ? null : (this.aeItemStack = AEItemStack.create( this.itemStack ))) : this.aeItemStack;
}
}
@@ -35,9 +35,9 @@ public class WrapperBCPipe implements IInventory
final private ForgeDirection dir;
public WrapperBCPipe(TileEntity te, ForgeDirection d) {
bc = (IBC) AppEng.instance.getIntegration( IntegrationType.BC );
ad = te;
dir = d;
this.bc = (IBC) AppEng.instance.getIntegration( IntegrationType.BC );
this.ad = te;
this.dir = d;
}
@Override
@@ -67,7 +67,7 @@ public class WrapperBCPipe implements IInventory
@Override
public void setInventorySlotContents(int i, ItemStack itemstack)
{
bc.addItemsToPipe( ad, itemstack, dir );
this.bc.addItemsToPipe( this.ad, itemstack, this.dir );
}
@Override
@@ -115,7 +115,7 @@ public class WrapperBCPipe implements IInventory
@Override
public boolean isItemValidForSlot(int i, ItemStack itemstack)
{
return bc.canAddItemsToPipe( ad, itemstack, dir );
return this.bc.canAddItemsToPipe( this.ad, itemstack, this.dir );
}
}
@@ -45,31 +45,31 @@ public class WrapperChainedInventory implements IInventory
private HashMap<Integer, InvOffset> offsets;
public WrapperChainedInventory(IInventory... inventories) {
setInventory( inventories );
this.setInventory( inventories );
}
public WrapperChainedInventory(List<IInventory> inventories) {
setInventory( inventories );
this.setInventory( inventories );
}
public void cycleOrder()
{
if ( l.size() > 1 )
if ( this.l.size() > 1 )
{
List<IInventory> newOrder = new ArrayList<IInventory>( l.size() );
newOrder.add( l.get( l.size() - 1 ) );
for (int x = 0; x < l.size() - 1; x++)
newOrder.add( l.get( x ) );
setInventory( newOrder );
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++)
newOrder.add( this.l.get( x ) );
this.setInventory( newOrder );
}
}
public void calculateSizes()
{
offsets = new HashMap<Integer, WrapperChainedInventory.InvOffset>();
this.offsets = new HashMap<Integer, WrapperChainedInventory.InvOffset>();
int offset = 0;
for (IInventory in : l)
for (IInventory in : this.l)
{
InvOffset io = new InvOffset();
io.offset = offset;
@@ -78,30 +78,30 @@ public class WrapperChainedInventory implements IInventory
for (int y = 0; y < io.size; y++)
{
offsets.put( y + io.offset, io );
this.offsets.put( y + io.offset, io );
}
offset += io.size;
}
fullSize = offset;
this.fullSize = offset;
}
public void setInventory(IInventory... a)
{
l = ImmutableList.copyOf( a );
calculateSizes();
this.l = ImmutableList.copyOf( a );
this.calculateSizes();
}
public void setInventory(List<IInventory> a)
{
l = a;
calculateSizes();
this.l = a;
this.calculateSizes();
}
public IInventory getInv(int idx)
{
InvOffset io = offsets.get( idx );
InvOffset io = this.offsets.get( idx );
if ( io != null )
{
return io.i;
@@ -111,7 +111,7 @@ public class WrapperChainedInventory implements IInventory
public int getInvSlot(int idx)
{
InvOffset io = offsets.get( idx );
InvOffset io = this.offsets.get( idx );
if ( io != null )
{
return idx - io.offset;
@@ -122,13 +122,13 @@ public class WrapperChainedInventory implements IInventory
@Override
public int getSizeInventory()
{
return fullSize;
return this.fullSize;
}
@Override
public ItemStack getStackInSlot(int idx)
{
InvOffset io = offsets.get( idx );
InvOffset io = this.offsets.get( idx );
if ( io != null )
{
return io.i.getStackInSlot( idx - io.offset );
@@ -139,7 +139,7 @@ public class WrapperChainedInventory implements IInventory
@Override
public ItemStack decrStackSize(int idx, int var2)
{
InvOffset io = offsets.get( idx );
InvOffset io = this.offsets.get( idx );
if ( io != null )
{
return io.i.decrStackSize( idx - io.offset, var2 );
@@ -150,7 +150,7 @@ public class WrapperChainedInventory implements IInventory
@Override
public ItemStack getStackInSlotOnClosing(int idx)
{
InvOffset io = offsets.get( idx );
InvOffset io = this.offsets.get( idx );
if ( io != null )
{
return io.i.getStackInSlotOnClosing( idx - io.offset );
@@ -161,7 +161,7 @@ public class WrapperChainedInventory implements IInventory
@Override
public void setInventorySlotContents(int idx, ItemStack var2)
{
InvOffset io = offsets.get( idx );
InvOffset io = this.offsets.get( idx );
if ( io != null )
{
io.i.setInventorySlotContents( idx - io.offset, var2 );
@@ -179,7 +179,7 @@ public class WrapperChainedInventory implements IInventory
{
int smallest = 64;
for (IInventory i : l)
for (IInventory i : this.l)
smallest = Math.min( smallest, i.getInventoryStackLimit() );
return smallest;
@@ -188,7 +188,7 @@ public class WrapperChainedInventory implements IInventory
@Override
public void markDirty()
{
for (IInventory i : l)
for (IInventory i : this.l)
{
i.markDirty();
}
@@ -219,7 +219,7 @@ public class WrapperChainedInventory implements IInventory
@Override
public boolean isItemValidForSlot(int idx, ItemStack itemstack)
{
InvOffset io = offsets.get( idx );
InvOffset io = this.offsets.get( idx );
if ( io != null )
{
return io.i.isItemValidForSlot( idx - io.offset, itemstack );
@@ -45,73 +45,73 @@ public class WrapperInvSlot
@Override
public ItemStack getStackInSlot(int i)
{
return inv.getStackInSlot( slot );
return this.inv.getStackInSlot( this.slot );
}
@Override
public ItemStack decrStackSize(int i, int num)
{
return inv.decrStackSize( slot, num );
return this.inv.decrStackSize( this.slot, num );
}
@Override
public ItemStack getStackInSlotOnClosing(int i)
{
return inv.getStackInSlotOnClosing( slot );
return this.inv.getStackInSlotOnClosing( this.slot );
}
@Override
public void setInventorySlotContents(int i, ItemStack itemstack)
{
inv.setInventorySlotContents( slot, itemstack );
this.inv.setInventorySlotContents( this.slot, itemstack );
}
@Override
public String getInventoryName()
{
return inv.getInventoryName();
return this.inv.getInventoryName();
}
@Override
public boolean hasCustomInventoryName()
{
return inv.hasCustomInventoryName();
return this.inv.hasCustomInventoryName();
}
@Override
public int getInventoryStackLimit()
{
return inv.getInventoryStackLimit();
return this.inv.getInventoryStackLimit();
}
@Override
public void markDirty()
{
inv.markDirty();
this.inv.markDirty();
}
@Override
public boolean isUseableByPlayer(EntityPlayer entityplayer)
{
return inv.isUseableByPlayer( entityplayer );
return this.inv.isUseableByPlayer( entityplayer );
}
@Override
public void openInventory()
{
inv.openInventory();
this.inv.openInventory();
}
@Override
public void closeInventory()
{
inv.closeInventory();
this.inv.closeInventory();
}
@Override
public boolean isItemValidForSlot(int i, ItemStack itemstack)
{
return isItemValid( itemstack ) && inv.isItemValidForSlot( slot, itemstack );
return WrapperInvSlot.this.isItemValid( itemstack ) && this.inv.isItemValidForSlot( this.slot, itemstack );
}
}
@@ -123,7 +123,7 @@ public class WrapperInvSlot
public IInventory getWrapper(int slot)
{
return new InternalInterfaceWrapper( inv, slot );
return new InternalInterfaceWrapper( this.inv, slot );
}
protected boolean isItemValid(ItemStack itemstack)
@@ -48,87 +48,87 @@ public class WrapperInventoryRange implements IInventory
}
public WrapperInventoryRange(IInventory a, int[] s, boolean ignoreValid) {
src = a;
slots = s;
this.src = a;
this.slots = s;
if ( slots == null )
slots = new int[0];
if ( this.slots == null )
this.slots = new int[0];
ignoreValidItems = ignoreValid;
this.ignoreValidItems = ignoreValid;
}
public WrapperInventoryRange(IInventory a, int _min, int _size, boolean ignoreValid) {
src = a;
slots = new int[_size];
this.src = a;
this.slots = new int[_size];
for (int x = 0; x < _size; x++)
slots[x] = _min + x;
ignoreValidItems = ignoreValid;
this.slots[x] = _min + x;
this.ignoreValidItems = ignoreValid;
}
@Override
public int getSizeInventory()
{
return slots.length;
return this.slots.length;
}
@Override
public ItemStack getStackInSlot(int var1)
{
return src.getStackInSlot( slots[var1] );
return this.src.getStackInSlot( this.slots[var1] );
}
@Override
public ItemStack decrStackSize(int var1, int var2)
{
return src.decrStackSize( slots[var1], var2 );
return this.src.decrStackSize( this.slots[var1], var2 );
}
@Override
public ItemStack getStackInSlotOnClosing(int var1)
{
return src.getStackInSlotOnClosing( slots[var1] );
return this.src.getStackInSlotOnClosing( this.slots[var1] );
}
@Override
public void setInventorySlotContents(int var1, ItemStack var2)
{
src.setInventorySlotContents( slots[var1], var2 );
this.src.setInventorySlotContents( this.slots[var1], var2 );
}
@Override
public String getInventoryName()
{
return src.getInventoryName();
return this.src.getInventoryName();
}
@Override
public int getInventoryStackLimit()
{
return src.getInventoryStackLimit();
return this.src.getInventoryStackLimit();
}
@Override
public void markDirty()
{
src.markDirty();
this.src.markDirty();
}
@Override
public boolean isUseableByPlayer(EntityPlayer var1)
{
return src.isUseableByPlayer( var1 );
return this.src.isUseableByPlayer( var1 );
}
@Override
public void openInventory()
{
src.openInventory();
this.src.openInventory();
}
@Override
public void closeInventory()
{
src.closeInventory();
this.src.closeInventory();
}
@Override
@@ -140,10 +140,10 @@ public class WrapperInventoryRange implements IInventory
@Override
public boolean isItemValidForSlot(int i, ItemStack itemstack)
{
if ( ignoreValidItems )
if ( this.ignoreValidItems )
return true;
return src.isItemValidForSlot( slots[i], itemstack );
return this.src.isItemValidForSlot( this.slots[i], itemstack );
}
}
@@ -30,19 +30,19 @@ public class WrapperMCISidedInventory extends WrapperInventoryRange implements I
public WrapperMCISidedInventory(ISidedInventory a, ForgeDirection d) {
super( a, a.getAccessibleSlotsFromSide( d.ordinal() ), false );
side = a;
dir = d;
this.side = a;
this.dir = d;
}
@Override
public boolean isItemValidForSlot(int i, ItemStack itemstack)
{
if ( ignoreValidItems )
if ( this.ignoreValidItems )
return true;
if ( side.isItemValidForSlot( slots[i], itemstack ) )
return side.canInsertItem( slots[i], itemstack, dir.ordinal() );
if ( this.side.isItemValidForSlot( this.slots[i], itemstack ) )
return this.side.canInsertItem( this.slots[i], itemstack, this.dir.ordinal() );
return false;
}
@@ -53,13 +53,13 @@ public class WrapperMCISidedInventory extends WrapperInventoryRange implements I
if ( is == null )
return false;
return side.canExtractItem( slots[i], is, dir.ordinal() );
return this.side.canExtractItem( this.slots[i], is, this.dir.ordinal() );
}
@Override
public ItemStack decrStackSize(int var1, int var2)
{
if ( canRemoveItemFromSlot( var1, getStackInSlot( var1 ) ) )
if ( this.canRemoveItemFromSlot( var1, this.getStackInSlot( var1 ) ) )
return super.decrStackSize( var1, var2 );
return null;
}
@@ -31,8 +31,8 @@ public class WrapperTEPipe implements IInventory
final ForgeDirection dir;
public WrapperTEPipe(TileEntity te, ForgeDirection d) {
ad = te;
dir = d;
this.ad = te;
this.dir = d;
}
@Override
@@ -47,13 +47,13 @@ public final class AEFluidStack extends AEStack<IAEFluidStack> implements IAEFlu
@Override
public String toString()
{
return getFluidStack().toString();
return this.getFluidStack().toString();
}
@Override
public IAETagCompound getTagCompound()
{
return tagCompound;
return this.tagCompound;
}
@Override
@@ -65,19 +65,19 @@ public final class AEFluidStack extends AEStack<IAEFluidStack> implements IAEFlu
// if ( priority < ((AEFluidStack) option).priority )
// priority = ((AEFluidStack) option).priority;
incStackSize( option.getStackSize() );
setCountRequestable( getCountRequestable() + option.getCountRequestable() );
setCraftable( isCraftable() || option.isCraftable() );
this.incStackSize( option.getStackSize() );
this.setCountRequestable( this.getCountRequestable() + option.getCountRequestable() );
this.setCraftable( this.isCraftable() || option.isCraftable() );
}
private AEFluidStack(AEFluidStack is) {
fluid = is.fluid;
stackSize = is.stackSize;
this.fluid = is.fluid;
this.stackSize = is.stackSize;
// priority = is.priority;
setCraftable( is.isCraftable() );
setCountRequestable( is.getCountRequestable() );
this.setCraftable( is.isCraftable() );
this.setCountRequestable( is.getCountRequestable() );
this.myHash = is.myHash;
}
@@ -86,16 +86,16 @@ public final class AEFluidStack extends AEStack<IAEFluidStack> implements IAEFlu
if ( is == null )
throw new RuntimeException( "Invalid Itemstack." );
fluid = is.getFluid();
this.fluid = is.getFluid();
if ( fluid == null )
if ( this.fluid == null )
throw new RuntimeException( "Fluid is null." );
stackSize = is.amount;
setCraftable( false );
setCountRequestable( 0 );
this.stackSize = is.amount;
this.setCraftable( false );
this.setCountRequestable( 0 );
myHash = fluid.hashCode() ^ (tagCompound == null ? 0 : System.identityHashCode( tagCompound ));
this.myHash = this.fluid.hashCode() ^ (this.tagCompound == null ? 0 : System.identityHashCode( this.tagCompound ));
}
public static AEFluidStack create(Object a)
@@ -114,7 +114,7 @@ public final class AEFluidStack extends AEStack<IAEFluidStack> implements IAEFlu
{
if ( ia instanceof AEFluidStack )
{
return ((AEFluidStack) ia).fluid == fluid && tagCompound == ((AEFluidStack) ia).tagCompound;
return ((AEFluidStack) ia).fluid == this.fluid && this.tagCompound == ((AEFluidStack) ia).tagCompound;
}
else if ( ia instanceof FluidStack )
{
@@ -122,7 +122,7 @@ public final class AEFluidStack extends AEStack<IAEFluidStack> implements IAEFlu
if ( is.fluidID == this.fluid.getID() )
{
NBTTagCompound ta = (NBTTagCompound) tagCompound;
NBTTagCompound ta = (NBTTagCompound) this.tagCompound;
NBTTagCompound tb = is.tag;
if ( ta == tb )
return true;
@@ -146,9 +146,9 @@ public final class AEFluidStack extends AEStack<IAEFluidStack> implements IAEFlu
@Override
public FluidStack getFluidStack()
{
FluidStack is = new FluidStack( fluid, (int) Math.min( Integer.MAX_VALUE, stackSize ) );
if ( tagCompound != null )
is.tag = tagCompound.getNBTTagCompoundCopy();
FluidStack is = new FluidStack( this.fluid, (int) Math.min( Integer.MAX_VALUE, this.stackSize ) );
if ( this.tagCompound != null )
is.tag = this.tagCompound.getNBTTagCompoundCopy();
return is;
}
@@ -197,8 +197,8 @@ public final class AEFluidStack extends AEStack<IAEFluidStack> implements IAEFlu
* 1 : 0); else
*/i.setBoolean( "Craft", this.isCraftable() );
if ( tagCompound != null )
i.setTag( "tag", (NBTTagCompound) tagCompound );
if ( this.tagCompound != null )
i.setTag( "tag", (NBTTagCompound) this.tagCompound );
else
i.removeTag( "tag" );
@@ -220,26 +220,26 @@ public final class AEFluidStack extends AEStack<IAEFluidStack> implements IAEFlu
@Override
public boolean hasTagCompound()
{
return tagCompound != null;
return this.tagCompound != null;
}
@Override
public int hashCode()
{
return myHash;
return this.myHash;
}
@Override
public int compareTo(AEFluidStack b)
{
int diff = hashCode() - b.hashCode();
int diff = this.hashCode() - b.hashCode();
return diff > 0 ? 1 : (diff < 0 ? -1 : 0);
}
@Override
void writeIdentity(ByteBuf i) throws IOException
{
byte[] name = fluid.getName().getBytes( "UTF-8" );
byte[] name = this.fluid.getName().getBytes( "UTF-8" );
i.writeByte( (byte) name.length );
i.writeBytes( name );
}
@@ -247,12 +247,12 @@ public final class AEFluidStack extends AEStack<IAEFluidStack> implements IAEFlu
@Override
void readNBT(ByteBuf i) throws IOException
{
if ( hasTagCompound() )
if ( this.hasTagCompound() )
{
ByteArrayOutputStream bytes = new ByteArrayOutputStream();
DataOutputStream data = new DataOutputStream( bytes );
CompressedStreamTools.write( (NBTTagCompound) getTagCompound(), data );
CompressedStreamTools.write( (NBTTagCompound) this.getTagCompound(), data );
byte[] tagBytes = bytes.toByteArray();
int size = tagBytes.length;
@@ -311,13 +311,13 @@ public final class AEFluidStack extends AEStack<IAEFluidStack> implements IAEFlu
@Override
public Fluid getFluid()
{
return fluid;
return this.fluid;
}
@Override
public IAEFluidStack empty()
{
IAEFluidStack dup = copy();
IAEFluidStack dup = this.copy();
dup.reset();
return dup;
}
@@ -327,12 +327,12 @@ public final class AEFluidStack extends AEStack<IAEFluidStack> implements IAEFlu
{
if ( st instanceof FluidStack )
{
return ((FluidStack) st).getFluid() == getFluid();
return ((FluidStack) st).getFluid() == this.getFluid();
}
if ( st instanceof IAEFluidStack )
{
return ((IAEFluidStack) st).getFluid() == getFluid();
return ((IAEFluidStack) st).getFluid() == this.getFluid();
}
return false;
+18 -18
View File
@@ -59,19 +59,19 @@ public class AEItemDef
static final AESharedNBT highTag = new AESharedNBT( Integer.MAX_VALUE );
public AEItemDef(Item it) {
item = it;
itemID = System.identityHashCode( item );
this.item = it;
this.itemID = System.identityHashCode( this.item );
}
public AEItemDef copy()
{
AEItemDef t = new AEItemDef( item );
t.def = def;
t.damageValue = damageValue;
t.displayDamage = displayDamage;
t.maxDamage = maxDamage;
t.tagCompound = tagCompound;
t.isOre = isOre;
AEItemDef t = new AEItemDef( this.item );
t.def = this.def;
t.damageValue = this.damageValue;
t.displayDamage = this.displayDamage;
t.maxDamage = this.maxDamage;
t.tagCompound = this.tagCompound;
t.isOre = this.isOre;
return t;
}
@@ -80,10 +80,10 @@ public class AEItemDef
{
if ( obj == null )
return false;
if ( getClass() != obj.getClass() )
if ( this.getClass() != obj.getClass() )
return false;
AEItemDef other = (AEItemDef) obj;
return other.damageValue == damageValue && other.item == item && tagCompound == other.tagCompound;
return other.damageValue == this.damageValue && other.item == this.item && this.tagCompound == other.tagCompound;
}
public int getDamageValueHack(ItemStack is)
@@ -94,15 +94,15 @@ public class AEItemDef
public boolean isItem(ItemStack otherStack)
{
// hackery!
int dmg = getDamageValueHack( otherStack );
int dmg = this.getDamageValueHack( otherStack );
if ( item == otherStack.getItem() && dmg == damageValue )
if ( this.item == otherStack.getItem() && dmg == this.damageValue )
{
if ( (tagCompound != null) == otherStack.hasTagCompound() )
if ( (this.tagCompound != null) == otherStack.hasTagCompound() )
return true;
if ( tagCompound != null && otherStack.hasTagCompound() )
return Platform.NBTEqualityTest( tagCompound, otherStack.getTagCompound() );
if ( this.tagCompound != null && otherStack.hasTagCompound() )
return Platform.NBTEqualityTest( this.tagCompound, otherStack.getTagCompound() );
return true;
}
@@ -111,7 +111,7 @@ public class AEItemDef
public void reHash()
{
def = itemID << Platform.DEF_OFFSET | damageValue;
myHash = def ^ (tagCompound == null ? 0 : System.identityHashCode( tagCompound ));
this.def = this.itemID << Platform.DEF_OFFSET | this.damageValue;
this.myHash = this.def ^ (this.tagCompound == null ? 0 : System.identityHashCode( this.tagCompound ));
}
}
+70 -70
View File
@@ -49,7 +49,7 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
@Override
public String toString()
{
return getItemStack().toString();
return this.getItemStack().toString();
}
@Override
@@ -61,25 +61,25 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
// if ( priority < ((AEItemStack) option).priority )
// priority = ((AEItemStack) option).priority;
incStackSize( option.getStackSize() );
setCountRequestable( getCountRequestable() + option.getCountRequestable() );
setCraftable( isCraftable() || option.isCraftable() );
this.incStackSize( option.getStackSize() );
this.setCountRequestable( this.getCountRequestable() + option.getCountRequestable() );
this.setCraftable( this.isCraftable() || option.isCraftable() );
}
private AEItemStack(AEItemStack is) {
def = is.def;
stackSize = is.stackSize;
setCraftable( is.isCraftable() );
setCountRequestable( is.getCountRequestable() );
this.def = is.def;
this.stackSize = is.stackSize;
this.setCraftable( is.isCraftable() );
this.setCountRequestable( is.getCountRequestable() );
}
protected AEItemStack(ItemStack is) {
if ( is == null )
throw new RuntimeException( "Invalid Itemstack." );
def = new AEItemDef( is.getItem() );
this.def = new AEItemDef( is.getItem() );
if ( def.item == null )
if ( this.def.item == null )
throw new RuntimeException( "This ItemStack is bad, it has a null item." );
/*
@@ -95,20 +95,20 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
/*
* Kinda hackery
*/
def.damageValue = def.getDamageValueHack( is );
def.displayDamage = is.getItemDamageForDisplay();
def.maxDamage = is.getMaxDamage();
this.def.damageValue = this.def.getDamageValueHack( is );
this.def.displayDamage = is.getItemDamageForDisplay();
this.def.maxDamage = is.getMaxDamage();
NBTTagCompound tagCompound = is.getTagCompound();
if ( tagCompound != null )
def.tagCompound = (AESharedNBT) AESharedNBT.getSharedTagCompound( tagCompound, is );
this.def.tagCompound = (AESharedNBT) AESharedNBT.getSharedTagCompound( tagCompound, is );
stackSize = is.stackSize;
setCraftable( false );
setCountRequestable( 0 );
this.stackSize = is.stackSize;
this.setCraftable( false );
this.setCountRequestable( 0 );
def.reHash();
def.isOre = OreHelper.instance.isOre( is );
this.def.reHash();
this.def.isOre = OreHelper.instance.isOre( is );
}
public static AEItemStack create(Object a)
@@ -123,7 +123,7 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
@Override
public Item getItem()
{
return def.item;
return this.def.item;
}
@Override
@@ -131,15 +131,15 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
{
if ( ia instanceof AEItemStack )
{
return ((AEItemStack) ia).def.equals( def );// && def.tagCompound == ((AEItemStack) ia).def.tagCompound;
return ((AEItemStack) ia).def.equals( this.def );// && def.tagCompound == ((AEItemStack) ia).def.tagCompound;
}
else if ( ia instanceof ItemStack )
{
ItemStack is = (ItemStack) ia;
if ( is.getItem() == def.item && is.getItemDamage() == this.def.damageValue )
if ( is.getItem() == this.def.item && is.getItemDamage() == this.def.damageValue )
{
NBTTagCompound ta = def.tagCompound;
NBTTagCompound ta = this.def.tagCompound;
NBTTagCompound tb = is.getTagCompound();
if ( ta == tb )
return true;
@@ -163,9 +163,9 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
@Override
public ItemStack getItemStack()
{
ItemStack is = new ItemStack( def.item, (int) Math.min( Integer.MAX_VALUE, stackSize ), def.damageValue );
if ( def.tagCompound != null )
is.setTagCompound( def.tagCompound.getNBTTagCompoundCopy() );
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() );
return is;
}
@@ -220,8 +220,8 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
*/
i.setShort( "Damage", (short) this.def.damageValue );
if ( def.tagCompound != null )
i.setTag( "tag", def.tagCompound );
if ( this.def.tagCompound != null )
i.setTag( "tag", this.def.tagCompound );
else
i.removeTag( "tag" );
@@ -247,30 +247,30 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
@Override
public boolean hasTagCompound()
{
return def.tagCompound != null;
return this.def.tagCompound != null;
}
@Override
public int hashCode()
{
return def.myHash;
return this.def.myHash;
}
@Override
public int compareTo(AEItemStack b)
{
int id = compare( def.item.hashCode(), b.def.item.hashCode() );
int damageValue = compare( def.damageValue, b.def.damageValue );
int displayDamage = compare( def.displayDamage, b.def.displayDamage );
int id = this.compare( this.def.item.hashCode(), b.def.item.hashCode() );
int damageValue = this.compare( this.def.damageValue, b.def.damageValue );
int displayDamage = this.compare( this.def.displayDamage, b.def.displayDamage );
// AELog.info( "NBT: " + nbt );
return id == 0 ? (damageValue == 0 ? (displayDamage == 0 ? compareNBT( b.def ) : displayDamage) : damageValue) : id;
return id == 0 ? (damageValue == 0 ? (displayDamage == 0 ? this.compareNBT( b.def ) : displayDamage) : damageValue) : id;
}
private int compareNBT(AEItemDef b)
{
int nbt = compare( (def.tagCompound == null ? 0 : def.tagCompound.getHash()), (b.tagCompound == null ? 0 : b.tagCompound.getHash()) );
int nbt = this.compare( (this.def.tagCompound == null ? 0 : this.def.tagCompound.getHash()), (b.tagCompound == null ? 0 : b.tagCompound.getHash()) );
if ( nbt == 0 )
return compare( System.identityHashCode( def.tagCompound ), System.identityHashCode( b.tagCompound ) );
return this.compare( System.identityHashCode( this.def.tagCompound ), System.identityHashCode( b.tagCompound ) );
return nbt;
}
@@ -282,28 +282,28 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
@SideOnly(Side.CLIENT)
public List getToolTip()
{
if ( def.tooltip != null )
return def.tooltip;
if ( this.def.tooltip != null )
return this.def.tooltip;
return def.tooltip = Platform.getTooltip( getItemStack() );
return this.def.tooltip = Platform.getTooltip( this.getItemStack() );
}
@SideOnly(Side.CLIENT)
public String getDisplayName()
{
if ( def.displayName != null )
return def.displayName;
if ( this.def.displayName != null )
return this.def.displayName;
return def.displayName = Platform.getItemDisplayName( getItemStack() );
return this.def.displayName = Platform.getItemDisplayName( this.getItemStack() );
}
@SideOnly(Side.CLIENT)
public String getModID()
{
if ( def.uniqueID != null )
return getModName( def.uniqueID );
if ( this.def.uniqueID != null )
return this.getModName( this.def.uniqueID );
return getModName( def.uniqueID = GameRegistry.findUniqueIdentifierFor( def.item ) );
return this.getModName( this.def.uniqueID = GameRegistry.findUniqueIdentifierFor( this.def.item ) );
}
private String getModName(UniqueIdentifier uniqueIdentifier)
@@ -317,7 +317,7 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
@Override
public IAEItemStack empty()
{
IAEItemStack dup = copy();
IAEItemStack dup = this.copy();
dup.reset();
return dup;
}
@@ -325,25 +325,25 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
@Override
public int getItemDamage()
{
return def.damageValue;
return this.def.damageValue;
}
@Override
void writeIdentity(ByteBuf i) throws IOException
{
i.writeShort( Item.itemRegistry.getIDForObject( def.item ) );
i.writeShort( getItemDamage() );
i.writeShort( Item.itemRegistry.getIDForObject( this.def.item ) );
i.writeShort( this.getItemDamage() );
}
@Override
void readNBT(ByteBuf i) throws IOException
{
if ( hasTagCompound() )
if ( this.hasTagCompound() )
{
ByteArrayOutputStream bytes = new ByteArrayOutputStream();
DataOutputStream data = new DataOutputStream( bytes );
CompressedStreamTools.write( (NBTTagCompound) getTagCompound(), data );
CompressedStreamTools.write( (NBTTagCompound) this.getTagCompound(), data );
byte[] tagBytes = bytes.toByteArray();
int size = tagBytes.length;
@@ -409,14 +409,14 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
{
IAEItemStack o = (IAEItemStack) st;
if ( sameOre( o ) )
if ( this.sameOre( o ) )
return true;
if ( o.getItem() == getItem() )
if ( o.getItem() == this.getItem() )
{
if ( def.item.isDamageable() )
if ( this.def.item.isDamageable() )
{
ItemStack a = getItemStack();
ItemStack a = this.getItemStack();
ItemStack b = o.getItemStack();
try
@@ -467,11 +467,11 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
OreHelper.instance.sameOre( this, o );
if ( o.getItem() == getItem() )
if ( o.getItem() == this.getItem() )
{
if ( def.item.isDamageable() )
if ( this.def.item.isDamageable() )
{
ItemStack a = getItemStack();
ItemStack a = this.getItemStack();
try
{
@@ -538,7 +538,7 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
}
else if ( fuzzy == FuzzyMode.PERCENT_99 )
{
if ( def.damageValue == 0 )
if ( this.def.damageValue == 0 )
newDef.displayDamage = 0;
else
newDef.displayDamage = 1;
@@ -546,8 +546,8 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
}
else
{
int breakpoint = fuzzy.calculateBreakPoint( def.maxDamage );
newDef.displayDamage = breakpoint <= def.displayDamage ? breakpoint : 0;
int breakpoint = fuzzy.calculateBreakPoint( this.def.maxDamage );
newDef.displayDamage = breakpoint <= this.def.displayDamage ? breakpoint : 0;
}
newDef.damageValue = newDef.displayDamage;
@@ -574,19 +574,19 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
{
if ( fuzzy == FuzzyMode.IGNORE_ALL )
{
newDef.displayDamage = def.maxDamage + 1;
newDef.displayDamage = this.def.maxDamage + 1;
}
else if ( fuzzy == FuzzyMode.PERCENT_99 )
{
if ( def.damageValue == 0 )
if ( this.def.damageValue == 0 )
newDef.displayDamage = 0;
else
newDef.displayDamage = def.maxDamage + 1;
newDef.displayDamage = this.def.maxDamage + 1;
}
else
{
int breakpoint = fuzzy.calculateBreakPoint( def.maxDamage );
newDef.displayDamage = def.displayDamage < breakpoint ? breakpoint - 1 : def.maxDamage + 1;
int breakpoint = fuzzy.calculateBreakPoint( this.def.maxDamage );
newDef.displayDamage = this.def.displayDamage < breakpoint ? breakpoint - 1 : this.def.maxDamage + 1;
}
newDef.damageValue = newDef.displayDamage;
@@ -600,7 +600,7 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
@Override
public IAETagCompound getTagCompound()
{
return def.tagCompound;
return this.def.tagCompound;
}
@Override
@@ -609,7 +609,7 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
if ( otherStack == null )
return false;
return def.equals( ((AEItemStack) otherStack).def );
return this.def.equals( ((AEItemStack) otherStack).def );
}
@Override
@@ -618,7 +618,7 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
if ( otherStack == null )
return false;
return def.isItem( otherStack );
return this.def.isItem( otherStack );
}
@Override
@@ -641,7 +641,7 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
public boolean isOre()
{
return def.isOre != null;
return this.def.isOre != null;
}
}
+14 -14
View File
@@ -43,32 +43,32 @@ public class AESharedNBT extends NBTTagCompound implements IAETagCompound
public int getHash()
{
return hash;
return this.hash;
}
@Override
public IItemComparison getSpecialComparison()
{
return comp;
return this.comp;
}
private AESharedNBT(Item itemID, int damageValue) {
super();
item = itemID;
meta = damageValue;
this.item = itemID;
this.meta = damageValue;
}
public AESharedNBT(int fakeValue) {
super();
item = null;
meta = 0;
hash = fakeValue;
this.item = null;
this.meta = 0;
this.hash = fakeValue;
}
@Override
public NBTTagCompound getNBTTagCompoundCopy()
{
return (NBTTagCompound) copy();
return (NBTTagCompound) this.copy();
}
public static AESharedNBT createFromCompound(Item itemID, int damageValue, NBTTagCompound c)
@@ -101,7 +101,7 @@ public class AESharedNBT extends NBTTagCompound implements IAETagCompound
public boolean matches(Item item, int meta, int orderlessHash)
{
return item == this.item && this.meta == meta && hash == orderlessHash;
return item == this.item && this.meta == meta && this.hash == orderlessHash;
}
public boolean comparePreciseWithRegistry(AESharedNBT tagCompound)
@@ -109,9 +109,9 @@ public class AESharedNBT extends NBTTagCompound implements IAETagCompound
if ( this == tagCompound )
return true;
if ( comp != null && tagCompound.comp != null )
if ( this.comp != null && tagCompound.comp != null )
{
return comp.sameAsPrecise( tagCompound.comp );
return this.comp.sameAsPrecise( tagCompound.comp );
}
return false;
@@ -124,12 +124,12 @@ public class AESharedNBT extends NBTTagCompound implements IAETagCompound
if ( tagCompound == null )
return false;
if ( comp == tagCompound.comp )
if ( this.comp == tagCompound.comp )
return true;
if ( comp != null )
if ( this.comp != null )
{
return comp.sameAsFuzzy( tagCompound.comp );
return this.comp.sameAsFuzzy( tagCompound.comp );
}
return false;
+17 -17
View File
@@ -34,36 +34,36 @@ public abstract class AEStack<StackType extends IAEStack> implements IAEStack<St
@Override
public boolean isMeaningful()
{
return stackSize != 0 || getCountRequestable() > 0 || isCraftable();
return this.stackSize != 0 || this.getCountRequestable() > 0 || this.isCraftable();
}
@Override
public StackType reset()
{
stackSize = 0;
this.stackSize = 0;
// priority = Integer.MIN_VALUE;
setCountRequestable( 0 );
setCraftable( false );
this.setCountRequestable( 0 );
this.setCraftable( false );
return (StackType) this;
}
@Override
public long getStackSize()
{
return stackSize;
return this.stackSize;
}
@Override
public StackType setStackSize(long ss)
{
stackSize = ss;
this.stackSize = ss;
return (StackType) this;
}
@Override
public long getCountRequestable()
{
return countRequestable;
return this.countRequestable;
}
@Override
@@ -76,7 +76,7 @@ public abstract class AEStack<StackType extends IAEStack> implements IAEStack<St
@Override
public boolean isCraftable()
{
return isCraftable;
return this.isCraftable;
}
@Override
@@ -89,25 +89,25 @@ public abstract class AEStack<StackType extends IAEStack> implements IAEStack<St
@Override
public void decStackSize(long i)
{
stackSize -= i;
this.stackSize -= i;
}
@Override
public void incStackSize(long i)
{
stackSize += i;
this.stackSize += i;
}
@Override
public void decCountRequestable(long i)
{
countRequestable -= i;
this.countRequestable -= i;
}
@Override
public void incCountRequestable(long i)
{
countRequestable += i;
this.countRequestable += i;
}
void putPacketValue(ByteBuf tag, long num)
@@ -167,17 +167,17 @@ public abstract class AEStack<StackType extends IAEStack> implements IAEStack<St
@Override
public void writeToPacket(ByteBuf i) throws IOException
{
byte mask = (byte) (getType( 0 ) | (getType( stackSize ) << 2) | (getType( getCountRequestable() ) << 4) | ((byte) (isCraftable ? 1 : 0) << 6) | (hasTagCompound() ? 1
byte mask = (byte) (this.getType( 0 ) | (this.getType( this.stackSize ) << 2) | (this.getType( this.getCountRequestable() ) << 4) | ((byte) (this.isCraftable ? 1 : 0) << 6) | (this.hasTagCompound() ? 1
: 0) << 7);
i.writeByte( mask );
writeIdentity( i );
this.writeIdentity( i );
readNBT( i );
this.readNBT( i );
// putPacketValue( i, priority );
putPacketValue( i, stackSize );
putPacketValue( i, getCountRequestable() );
this.putPacketValue( i, this.stackSize );
this.putPacketValue( i, this.getCountRequestable() );
}
}
+25 -25
View File
@@ -52,7 +52,7 @@ public final class ItemList<StackType extends IAEStack> implements IItemList<Sta
public ItemList( Class<? extends IAEStack> cla )
{
clz = cla;
this.clz = cla;
}
private boolean checkStackType( StackType st )
@@ -60,8 +60,8 @@ public final class ItemList<StackType extends IAEStack> implements IItemList<Sta
if ( st == null )
return true;
if ( !clz.isInstance( st ) )
throw new RuntimeException( "WRONG TYPE - got " + st.getClass().getName() + " expected " + clz.getName() );
if ( !this.clz.isInstance( st ) )
throw new RuntimeException( "WRONG TYPE - got " + st.getClass().getName() + " expected " + this.clz.getName() );
return false;
}
@@ -69,10 +69,10 @@ public final class ItemList<StackType extends IAEStack> implements IItemList<Sta
@Override
synchronized public void add( StackType option )
{
if ( checkStackType( option ) )
if ( this.checkStackType( option ) )
return;
StackType st = records.get( option );
StackType st = this.records.get( option );
if ( st != null )
{
@@ -83,17 +83,17 @@ public final class ItemList<StackType extends IAEStack> implements IItemList<Sta
StackType opt = ( StackType ) option.copy();
// opt.setPriority( currentPriority );
records.put( opt, opt );
this.records.put( opt, opt );
}
@Override
synchronized public void addStorage( StackType option ) // adds a stack as
// stored.
{
if ( checkStackType( option ) )
if ( this.checkStackType( option ) )
return;
StackType st = records.get( option );
StackType st = this.records.get( option );
if ( st != null )
{
@@ -104,17 +104,17 @@ public final class ItemList<StackType extends IAEStack> implements IItemList<Sta
StackType opt = ( StackType ) option.copy();
// opt.setPriority( currentPriority );
records.put( opt, opt );
this.records.put( opt, opt );
}
@Override
synchronized public void addCrafting( StackType option ) // adds a stack as
// craftable.
{
if ( checkStackType( option ) )
if ( this.checkStackType( option ) )
return;
StackType st = records.get( option );
StackType st = this.records.get( option );
if ( st != null )
{
@@ -128,7 +128,7 @@ public final class ItemList<StackType extends IAEStack> implements IItemList<Sta
opt.setStackSize( 0 );
opt.setCraftable( true );
records.put( opt, opt );
this.records.put( opt, opt );
}
@Override
@@ -136,10 +136,10 @@ public final class ItemList<StackType extends IAEStack> implements IItemList<Sta
// as
// requestable.
{
if ( checkStackType( option ) )
if ( this.checkStackType( option ) )
return;
StackType st = records.get( option );
StackType st = this.records.get( option );
if ( st != null )
{
@@ -154,7 +154,7 @@ public final class ItemList<StackType extends IAEStack> implements IItemList<Sta
opt.setCraftable( false );
opt.setCountRequestable( opt.getCountRequestable() );
records.put( opt, opt );
this.records.put( opt, opt );
}
@Override
@@ -182,16 +182,16 @@ public final class ItemList<StackType extends IAEStack> implements IItemList<Sta
@Override
synchronized public Iterator<StackType> iterator()
{
return new MeaningfulIterator<StackType>( records.values().iterator() );
return new MeaningfulIterator<StackType>( this.records.values().iterator() );
}
@Override
synchronized public StackType findPrecise( StackType i )
{
if ( checkStackType( i ) )
if ( this.checkStackType( i ) )
return null;
StackType is = records.get( i );
StackType is = this.records.get( i );
if ( is != null )
{
return is;
@@ -203,26 +203,26 @@ public final class ItemList<StackType extends IAEStack> implements IItemList<Sta
@Override
synchronized public int size()
{
return records.values().size();
return this.records.values().size();
}
@Override
public boolean isEmpty()
{
return !iterator().hasNext();
return !this.iterator().hasNext();
}
public Collection<StackType> findFuzzyDamage( AEItemStack filter, FuzzyMode fuzzy, boolean ignoreMeta )
{
StackType low = ( StackType ) filter.getLow( fuzzy, ignoreMeta );
StackType high = ( StackType ) filter.getHigh( fuzzy, ignoreMeta );
return records.subMap( low, true, high, true ).descendingMap().values();
return this.records.subMap( low, true, high, true ).descendingMap().values();
}
@Override
public Collection<StackType> findFuzzy( StackType filter, FuzzyMode fuzzy )
{
if ( checkStackType( filter ) )
if ( this.checkStackType( filter ) )
return new ArrayList<StackType>();
if ( filter instanceof IAEFluidStack )
@@ -244,19 +244,19 @@ public final class ItemList<StackType extends IAEStack> implements IItemList<Sta
if ( or.getAEEquivalents().size() == 1 )
{
IAEItemStack is = or.getAEEquivalents().get( 0 );
return findFuzzyDamage( ( AEItemStack ) is, fuzzy, is.getItemDamage() == OreDictionary.WILDCARD_VALUE );
return this.findFuzzyDamage( ( AEItemStack ) is, fuzzy, is.getItemDamage() == OreDictionary.WILDCARD_VALUE );
}
else
{
Collection<StackType> output = new LinkedList<StackType>();
for ( IAEItemStack is : or.getAEEquivalents() )
output.addAll( findFuzzyDamage( ( AEItemStack ) is, fuzzy, is.getItemDamage() == OreDictionary.WILDCARD_VALUE ) );
output.addAll( this.findFuzzyDamage( ( AEItemStack ) is, fuzzy, is.getItemDamage() == OreDictionary.WILDCARD_VALUE ) );
return output;
}
}
return findFuzzyDamage( ais, fuzzy, false );
return this.findFuzzyDamage( ais, fuzzy, false );
}
}
+10 -10
View File
@@ -32,47 +32,47 @@ public class ItemModList implements IItemContainer<IAEItemStack>
final IItemContainer<IAEItemStack> overrides = AEApi.instance().storage().createItemList();
public ItemModList(IItemContainer<IAEItemStack> backend) {
backingStore = backend;
this.backingStore = backend;
}
@Override
public void add(IAEItemStack option)
{
IAEItemStack over = overrides.findPrecise( option );
IAEItemStack over = this.overrides.findPrecise( option );
if ( over == null )
{
over = backingStore.findPrecise( option );
over = this.backingStore.findPrecise( option );
if ( over == null )
overrides.add( option );
this.overrides.add( option );
else
{
option.add( over );
overrides.add( option );
this.overrides.add( option );
}
}
else
overrides.add( option );
this.overrides.add( option );
}
@Override
public IAEItemStack findPrecise(IAEItemStack i)
{
IAEItemStack over = overrides.findPrecise( i );
IAEItemStack over = this.overrides.findPrecise( i );
if ( over == null )
return backingStore.findPrecise( i );
return this.backingStore.findPrecise( i );
return over;
}
@Override
public Collection<IAEItemStack> findFuzzy(IAEItemStack input, FuzzyMode fuzzy)
{
return overrides.findFuzzy( input, fuzzy );
return this.overrides.findFuzzy( input, fuzzy );
}
@Override
public boolean isEmpty()
{
return overrides.isEmpty() && backingStore.isEmpty();
return this.overrides.isEmpty() && this.backingStore.isEmpty();
}
}
@@ -61,7 +61,7 @@ public class MeaningfulIterator<StackType extends IAEStack> implements Iterator<
@Override
public void remove()
{
parent.remove();
this.parent.remove();
}
}
@@ -36,14 +36,14 @@ public class OreHelper
ItemRef(ItemStack stack)
{
ref = stack.getItem();
this.ref = stack.getItem();
if ( stack.getItem().isDamageable() )
damage = 0; // IGNORED
this.damage = 0; // IGNORED
else
damage = stack.getItemDamage(); // might be important...
this.damage = stack.getItemDamage(); // might be important...
hash = ref.hashCode() ^ damage;
this.hash = this.ref.hashCode() ^ this.damage;
}
final Item ref;
@@ -55,16 +55,16 @@ public class OreHelper
{
if ( obj == null )
return false;
if ( getClass() != obj.getClass() )
if ( this.getClass() != obj.getClass() )
return false;
ItemRef other = (ItemRef) obj;
return damage == other.damage && ref == other.ref;
return this.damage == other.damage && this.ref == other.ref;
}
@Override
public int hashCode()
{
return hash;
return this.hash;
}
}
@@ -81,12 +81,12 @@ public class OreHelper
public OreReference isOre(ItemStack ItemStack)
{
ItemRef ir = new ItemRef( ItemStack );
OreResult or = references.get( ir );
OreResult or = this.references.get( ir );
if ( or == null )
{
or = new OreResult();
references.put( ir, or );
this.references.put( ir, or );
OreReference ref = new OreReference();
Collection<Integer> ores = ref.getOres();
@@ -36,27 +36,27 @@ public class OreReference
public Collection<ItemStack> getEquivalents()
{
return otherOptions;
return this.otherOptions;
}
public List<IAEItemStack> getAEEquivalents()
{
if ( aeOtherOptions == null )
if ( this.aeOtherOptions == null )
{
aeOtherOptions = new ArrayList<IAEItemStack>( otherOptions.size() );
this.aeOtherOptions = new ArrayList<IAEItemStack>( this.otherOptions.size() );
// SUMMON AE STACKS!
for (ItemStack is : otherOptions)
for (ItemStack is : this.otherOptions)
if ( is.getItem() != null )
aeOtherOptions.add( AEItemStack.create( is ) );
this.aeOtherOptions.add( AEItemStack.create( is ) );
}
return aeOtherOptions;
return this.aeOtherOptions;
}
public Collection<Integer> getOres()
{
return ores;
return this.ores;
}
}
@@ -31,9 +31,9 @@ public class SharedSearchObject
public AESharedNBT shared;
public SharedSearchObject(Item itemID, int damageValue, NBTTagCompound tagCompound) {
def = (damageValue << Platform.DEF_OFFSET) | Item.itemRegistry.getIDForObject( itemID );
hash = Platform.NBTOrderlessHash( tagCompound );
compound = tagCompound;
this.def = (damageValue << Platform.DEF_OFFSET) | Item.itemRegistry.getIDForObject( itemID );
this.hash = Platform.NBTOrderlessHash( tagCompound );
this.compound = tagCompound;
}
@Override
@@ -41,12 +41,12 @@ public class SharedSearchObject
{
if ( obj == null )
return false;
if ( getClass() != obj.getClass() )
if ( this.getClass() != obj.getClass() )
return false;
SharedSearchObject other = (SharedSearchObject) obj;
if ( def == other.def && hash == other.hash )
if ( this.def == other.def && this.hash == other.hash )
{
return Platform.NBTEqualityTest( compound, other.compound );
return Platform.NBTEqualityTest( this.compound, other.compound );
}
return false;
}
@@ -54,7 +54,7 @@ public class SharedSearchObject
@Override
public int hashCode()
{
return def ^ hash;
return this.def ^ this.hash;
}
}
@@ -32,20 +32,20 @@ public class AEInvIterator implements Iterator<IAEItemStack>
int x = 0;
public AEInvIterator(AppEngInternalAEInventory i) {
inv = i;
size = inv.getSizeInventory();
this.inv = i;
this.size = this.inv.getSizeInventory();
}
@Override
public boolean hasNext()
{
return x < size;
return this.x < this.size;
}
@Override
public IAEItemStack next()
{
return inv.getAEStackInSlot( x++ );
return this.inv.getAEStackInSlot( this.x++ );
}
@Override
@@ -33,13 +33,13 @@ public class ChainedIterator<T> implements Iterator<T>
@Override
public boolean hasNext()
{
return offset < list.length;
return this.offset < this.list.length;
}
@Override
public T next()
{
return list[offset++];
return this.list[this.offset++];
}
@Override
@@ -32,20 +32,20 @@ public class InvIterator implements Iterator<ItemStack>
int x = 0;
public InvIterator(IInventory i) {
inv = i;
size = inv.getSizeInventory();
this.inv = i;
this.size = this.inv.getSizeInventory();
}
@Override
public boolean hasNext()
{
return x < size;
return this.x < this.size;
}
@Override
public ItemStack next()
{
return inv.getStackInSlot( x++ );
return this.inv.getStackInSlot( this.x++ );
}
@Override
@@ -36,13 +36,13 @@ public class ProxyNodeIterator implements Iterator<IGridNode>
@Override
public boolean hasNext()
{
return hosts.hasNext();
return this.hosts.hasNext();
}
@Override
public IGridNode next()
{
IGridHost host = hosts.next();
IGridHost host = this.hosts.next();
return host.getGridNode( ForgeDirection.UNKNOWN );
}
@@ -37,15 +37,15 @@ public class StackToSlotIterator implements Iterator<ItemSlot>
@Override
public boolean hasNext()
{
return is.hasNext();
return this.is.hasNext();
}
@Override
public ItemSlot next()
{
iss.slot = x++;
iss.setItemStack( is.next() );
return iss;
this.iss.slot = this.x++;
this.iss.setItemStack( this.is.next() );
return this.iss;
}
@Override
@@ -31,27 +31,27 @@ public class FuzzyPriorityList<T extends IAEStack<T>> implements IPartitionList<
final FuzzyMode mode;
public FuzzyPriorityList(IItemList<T> in, FuzzyMode mode) {
list = in;
this.list = in;
this.mode = mode;
}
@Override
public boolean isListed(T input)
{
Collection<T> out = list.findFuzzy( input, mode );
Collection<T> out = this.list.findFuzzy( input, this.mode );
return out != null && !out.isEmpty();
}
@Override
public boolean isEmpty()
{
return list.isEmpty();
return this.list.isEmpty();
}
@Override
public Iterable<T> getItems()
{
return list;
return this.list;
}
}
@@ -32,21 +32,21 @@ public class MergedPriorityList<T extends IAEStack<T>> implements IPartitionList
public void addNewList(IPartitionList<T> list, boolean isWhitelist)
{
if ( isWhitelist )
positive.add( list );
this.positive.add( list );
else
negative.add( list );
this.negative.add( list );
}
@Override
public boolean isListed(T input)
{
for (IPartitionList<T> l : negative)
for (IPartitionList<T> l : this.negative)
if ( l.isListed( input ) )
return false;
if ( !positive.isEmpty() )
if ( !this.positive.isEmpty() )
{
for (IPartitionList<T> l : positive)
for (IPartitionList<T> l : this.positive)
if ( l.isListed( input ) )
return true;
@@ -59,7 +59,7 @@ public class MergedPriorityList<T extends IAEStack<T>> implements IPartitionList
@Override
public boolean isEmpty()
{
return positive.isEmpty() && negative.isEmpty();
return this.positive.isEmpty() && this.negative.isEmpty();
}
@Override
@@ -27,25 +27,25 @@ public class PrecisePriorityList<T extends IAEStack<T>> implements IPartitionLis
final IItemList<T> list;
public PrecisePriorityList(IItemList<T> in) {
list = in;
this.list = in;
}
@Override
public boolean isListed(T input)
{
return list.findPrecise( input ) != null;
return this.list.findPrecise( input ) != null;
}
@Override
public boolean isEmpty()
{
return list.isEmpty();
return this.list.isEmpty();
}
@Override
public Iterable<T> getItems()
{
return list;
return this.list;
}
}