implemented validForPass on all inventory handlers; allowed crafting to skip second pass.

This commit is contained in:
AlgorithmX2
2014-06-20 02:10:02 -05:00
parent 755e87f006
commit 04797294bb
12 changed files with 78 additions and 6 deletions
+6
View File
@@ -305,4 +305,10 @@ public class WirelessTerminalGuiObject implements IPortableCell, IActionHost
return null; return null;
} }
@Override
public boolean validForPass(int i)
{
return itemStorage.validForPass( i );
}
} }
+6
View File
@@ -300,4 +300,10 @@ public class CraftingCache implements IGridCache, ICraftingProviderHelper, ICell
return o; return o;
} }
@Override
public boolean validForPass(int i)
{
return i == 1;
}
} }
+6
View File
@@ -106,4 +106,10 @@ public class CreativeCellInventory implements IMEInventoryHandler<IAEItemStack>
return 0; return 0;
} }
@Override
public boolean validForPass(int i)
{
return true;
}
} }
+8 -2
View File
@@ -25,13 +25,13 @@ public class MEInventoryHandler<T extends IAEStack<T>> implements IMEInventoryHa
public AccessRestriction myAccess = AccessRestriction.READ_WRITE; public AccessRestriction myAccess = AccessRestriction.READ_WRITE;
public IPartitionList<T> myPartitionList = new DefaultPriorityList<T>(); public IPartitionList<T> myPartitionList = new DefaultPriorityList<T>();
public MEInventoryHandler(IMEInventory<T> i,Class<? extends IAEStack> cla) { public MEInventoryHandler(IMEInventory<T> i, Class<? extends IAEStack> cla) {
clz = cla; clz = cla;
if ( i instanceof IMEInventoryHandler ) if ( i instanceof IMEInventoryHandler )
internal = (IMEInventoryHandler<T>) i; internal = (IMEInventoryHandler<T>) i;
else else
internal = new MEPassthru<T>( i,clz ); internal = new MEPassthru<T>( i, clz );
monitor = internal instanceof IMEMonitor ? (IMEMonitor<T>) internal : null; monitor = internal instanceof IMEMonitor ? (IMEMonitor<T>) internal : null;
} }
@@ -113,4 +113,10 @@ public class MEInventoryHandler<T extends IAEStack<T>> implements IMEInventoryHa
return internal; return internal;
} }
@Override
public boolean validForPass(int i)
{
return true;
}
} }
+6
View File
@@ -245,4 +245,10 @@ public class MEMonitorIInventory implements IMEInventory<IAEItemStack>, IMEMonit
return StorageChannel.ITEMS; return StorageChannel.ITEMS;
} }
@Override
public boolean validForPass(int i)
{
return true;
}
} }
+7 -1
View File
@@ -20,7 +20,7 @@ public class MEPassthru<T extends IAEStack<T>> implements IMEInventoryHandler<T>
return internal; return internal;
} }
public MEPassthru(IMEInventory<T> i,Class<? extends IAEStack> cla) { public MEPassthru(IMEInventory<T> i, Class<? extends IAEStack> cla) {
setInternal( i ); setInternal( i );
clz = cla; clz = cla;
} }
@@ -84,4 +84,10 @@ public class MEPassthru<T extends IAEStack<T>> implements IMEInventoryHandler<T>
return 0; return 0;
} }
@Override
public boolean validForPass(int i)
{
return true;
}
} }
+6
View File
@@ -272,4 +272,10 @@ public class NetworkInventoryHandler<T extends IAEStack<T>> implements IMEInvent
return 0; return 0;
} }
@Override
public boolean validForPass(int i)
{
return true;
}
} }
+6
View File
@@ -65,4 +65,10 @@ public class NullInventory<T extends IAEStack<T>> implements IMEInventoryHandler
return 0; return 0;
} }
@Override
public boolean validForPass(int i)
{
return i == 2;
}
} }
+7 -1
View File
@@ -19,7 +19,7 @@ public class SecurityInventory implements IMEInventoryHandler<IAEItemStack>
{ {
final TileSecurity securityTile; final TileSecurity securityTile;
final public IItemList<IAEItemStack> storedItems = new ItemList(IAEItemStack.class); final public IItemList<IAEItemStack> storedItems = new ItemList( IAEItemStack.class );
public SecurityInventory(TileSecurity ts) { public SecurityInventory(TileSecurity ts) {
securityTile = ts; securityTile = ts;
@@ -146,4 +146,10 @@ public class SecurityInventory implements IMEInventoryHandler<IAEItemStack>
return 0; return 0;
} }
@Override
public boolean validForPass(int i)
{
return true;
}
} }
+6
View File
@@ -74,4 +74,10 @@ public class VoidFluidInventory implements IMEInventoryHandler<IAEFluidStack>
return 0; return 0;
} }
@Override
public boolean validForPass(int i)
{
return i == 2;
}
} }
+6
View File
@@ -74,4 +74,10 @@ public class VoidItemInventory implements IMEInventoryHandler<IAEItemStack>
return 0; return 0;
} }
@Override
public boolean validForPass(int i)
{
return i == 2;
}
} }
@@ -219,6 +219,12 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IAEAppEn
return false; return false;
} }
@Override
public boolean acceptsPlans()
{
return inv.getStackInSlot( 10 ) == null;
}
private boolean hasPattern() private boolean hasPattern()
{ {
return myPlan != null && inv.getStackInSlot( 10 ) != null; return myPlan != null && inv.getStackInSlot( 10 ) != null;