diff --git a/helpers/DualityInterface.java b/helpers/DualityInterface.java index 1cf677658..4de76ed6b 100644 --- a/helpers/DualityInterface.java +++ b/helpers/DualityInterface.java @@ -47,6 +47,7 @@ import appeng.api.parts.IPart; import appeng.api.storage.IMEInventory; import appeng.api.storage.IMEMonitor; import appeng.api.storage.IStorageMonitorable; +import appeng.api.storage.StorageChannel; import appeng.api.storage.data.IAEFluidStack; import appeng.api.storage.data.IAEItemStack; import appeng.api.util.AECableType; @@ -509,8 +510,8 @@ public class DualityInterface implements IGridTickable, ISegmentedInventory, ISt return patterns; } - MEMonitorPassthu items = new MEMonitorPassthu( new NullInventory(), IAEItemStack.class ); - MEMonitorPassthu fluids = new MEMonitorPassthu( new NullInventory(), IAEFluidStack.class ); + MEMonitorPassthu items = new MEMonitorPassthu( new NullInventory(), StorageChannel.ITEMS ); + MEMonitorPassthu fluids = new MEMonitorPassthu( new NullInventory(), StorageChannel.FLUIDS ); public void gridChanged() { diff --git a/me/storage/CellInventoryHandler.java b/me/storage/CellInventoryHandler.java index 855867534..aa0604a0f 100644 --- a/me/storage/CellInventoryHandler.java +++ b/me/storage/CellInventoryHandler.java @@ -11,6 +11,7 @@ import appeng.api.implementations.items.IUpgradeModule; import appeng.api.storage.ICellInventory; import appeng.api.storage.ICellInventoryHandler; import appeng.api.storage.IMEInventory; +import appeng.api.storage.StorageChannel; import appeng.api.storage.data.IAEItemStack; import appeng.api.storage.data.IItemList; import appeng.util.Platform; @@ -38,7 +39,7 @@ public class CellInventoryHandler extends MEInventoryHandler imple } CellInventoryHandler(IMEInventory c) { - super( c, IAEItemStack.class ); + super( c, StorageChannel.ITEMS ); ICellInventory ci = getCellInv(); if ( ci != null ) diff --git a/me/storage/DriveWatcher.java b/me/storage/DriveWatcher.java index 85f5681dd..830bbd174 100644 --- a/me/storage/DriveWatcher.java +++ b/me/storage/DriveWatcher.java @@ -17,7 +17,7 @@ public class DriveWatcher> extends MEInventoryHandler final IChestOrDrive cord; public DriveWatcher(IMEInventory i, ItemStack is, ICellHandler han, IChestOrDrive cod) { - super( i, i.getChannel().type ); + super( i, i.getChannel() ); this.is = is; handler = han; cord = cod; diff --git a/me/storage/MEInventoryHandler.java b/me/storage/MEInventoryHandler.java index 27e4d1367..0e56e166e 100644 --- a/me/storage/MEInventoryHandler.java +++ b/me/storage/MEInventoryHandler.java @@ -16,7 +16,7 @@ import appeng.util.prioitylist.IPartitionList; public class MEInventoryHandler> implements IMEInventoryHandler { - Class clz; + final StorageChannel channel; final protected IMEMonitor monitor; final protected IMEInventoryHandler internal; @@ -25,13 +25,13 @@ public class MEInventoryHandler> implements IMEInventoryHa public AccessRestriction myAccess = AccessRestriction.READ_WRITE; public IPartitionList myPartitionList = new DefaultPriorityList(); - public MEInventoryHandler(IMEInventory i, Class cla) { - clz = cla; + public MEInventoryHandler(IMEInventory i, StorageChannel channel ) { + this.channel = channel; if ( i instanceof IMEInventoryHandler ) internal = (IMEInventoryHandler) i; else - internal = new MEPassthru( i, clz ); + internal = new MEPassthru( i ); monitor = internal instanceof IMEMonitor ? (IMEMonitor) internal : null; } diff --git a/me/storage/MEMonitorPassthu.java b/me/storage/MEMonitorPassthu.java index ba29a0f48..7af29a52f 100644 --- a/me/storage/MEMonitorPassthu.java +++ b/me/storage/MEMonitorPassthu.java @@ -9,22 +9,24 @@ import appeng.api.networking.storage.IBaseMonitor; import appeng.api.storage.IMEInventory; import appeng.api.storage.IMEMonitor; import appeng.api.storage.IMEMonitorHandlerReceiver; +import appeng.api.storage.StorageChannel; import appeng.api.storage.data.IAEStack; import appeng.api.storage.data.IItemList; import appeng.util.Platform; import appeng.util.inv.ItemListIgnoreCrafting; -import appeng.util.item.ItemList; public class MEMonitorPassthu> extends MEPassthru implements IMEMonitor, IMEMonitorHandlerReceiver { HashMap, Object> listeners = new HashMap(); IMEMonitor monitor; + StorageChannel channel; public BaseActionSource changeSource; - public MEMonitorPassthu(IMEInventory i, Class cla) { - super( i, cla ); + public MEMonitorPassthu(IMEInventory i, StorageChannel channel ) { + super( i ); + this.channel = channel; if ( i instanceof IMEMonitor ) monitor = (IMEMonitor) i; } @@ -36,13 +38,13 @@ public class MEMonitorPassthu> extends MEPassthru imple monitor.removeListener( this ); monitor = null; - IItemList before = getInternal() == null ? new ItemList( clz ) : getInternal().getAvailableItems( new ItemListIgnoreCrafting( new ItemList( clz ) ) ); + IItemList before = getInternal() == null ? channel.createList() : getInternal().getAvailableItems( new ItemListIgnoreCrafting( channel.createList() ) ); super.setInternal( i ); if ( i instanceof IMEMonitor ) monitor = (IMEMonitor) i; - IItemList after = getInternal() == null ? new ItemList( clz ) : getInternal().getAvailableItems( new ItemListIgnoreCrafting( new ItemList( clz ) ) ); + IItemList after = getInternal() == null ? channel.createList() : getInternal().getAvailableItems( new ItemListIgnoreCrafting( channel.createList() ) ); if ( monitor != null ) monitor.addListener( this, monitor ); @@ -74,7 +76,7 @@ public class MEMonitorPassthu> extends MEPassthru imple { if ( monitor == null ) { - IItemList out = new ItemList( clz ); + IItemList out = channel.createList(); getInternal().getAvailableItems( new ItemListIgnoreCrafting( out ) ); return out; } diff --git a/me/storage/MEPassthru.java b/me/storage/MEPassthru.java index d6a2b58a5..0b1503978 100644 --- a/me/storage/MEPassthru.java +++ b/me/storage/MEPassthru.java @@ -12,7 +12,6 @@ import appeng.api.storage.data.IItemList; public class MEPassthru> implements IMEInventoryHandler { - Class clz; private IMEInventory internal; protected IMEInventory getInternal() @@ -20,9 +19,8 @@ public class MEPassthru> implements IMEInventoryHandler return internal; } - public MEPassthru(IMEInventory i, Class cla) { + public MEPassthru( IMEInventory i ) { setInternal( i ); - clz = cla; } public void setInternal(IMEInventory i) diff --git a/me/storage/SecurityInventory.java b/me/storage/SecurityInventory.java index 2de9b8ab3..5eece85dc 100644 --- a/me/storage/SecurityInventory.java +++ b/me/storage/SecurityInventory.java @@ -15,7 +15,6 @@ import appeng.api.storage.data.IAEItemStack; import appeng.api.storage.data.IItemList; import appeng.me.GridAccessException; import appeng.tile.misc.TileSecurity; -import appeng.util.item.ItemList; public class SecurityInventory implements IMEInventoryHandler { diff --git a/parts/automation/PartFormationPlane.java b/parts/automation/PartFormationPlane.java index 3320bf683..46f899880 100644 --- a/parts/automation/PartFormationPlane.java +++ b/parts/automation/PartFormationPlane.java @@ -64,7 +64,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine int priority = 0; boolean wasActive = false; boolean blocked = false; - MEInventoryHandler myHandler = new MEInventoryHandler( this, IAEItemStack.class ); + MEInventoryHandler myHandler = new MEInventoryHandler( this, StorageChannel.ITEMS ); AppEngInternalAEInventory Config = new AppEngInternalAEInventory( this, 63 ); public PartFormationPlane(ItemStack is) { diff --git a/parts/misc/PartStorageBus.java b/parts/misc/PartStorageBus.java index 77115a90b..9f218c9b8 100644 --- a/parts/misc/PartStorageBus.java +++ b/parts/misc/PartStorageBus.java @@ -256,7 +256,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC if ( inv != null ) { - handler = new MEInventoryHandler( inv, IAEItemStack.class ); + handler = new MEInventoryHandler( inv, StorageChannel.ITEMS ); handler.myAccess = (AccessRestriction) this.getConfigManager().getSetting( Settings.ACCESS ); handler.myWhitelist = getInstalledUpgrades( Upgrades.INVERTER ) > 0 ? IncludeExclude.BLACKLIST : IncludeExclude.WHITELIST; diff --git a/tile/crafting/TileCraftingTile.java b/tile/crafting/TileCraftingTile.java index 37ea18c26..4150feb65 100644 --- a/tile/crafting/TileCraftingTile.java +++ b/tile/crafting/TileCraftingTile.java @@ -32,7 +32,6 @@ import appeng.tile.events.AETileEventHandler; import appeng.tile.events.TileEventType; import appeng.tile.grid.AENetworkTile; import appeng.util.Platform; -import appeng.util.item.ItemList; public class TileCraftingTile extends AENetworkTile implements IAEMultiBlock, IPowerChannelState { diff --git a/tile/storage/TileChest.java b/tile/storage/TileChest.java index d29663a28..f65e8926e 100644 --- a/tile/storage/TileChest.java +++ b/tile/storage/TileChest.java @@ -362,7 +362,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan if ( h == null ) return null; - MEInventoryHandler ih = new MEInventoryHandler( h, h.getChannel().type ); + MEInventoryHandler ih = new MEInventoryHandler( h, h.getChannel() ); ih.myPriority = priority; MEMonitorHandler g = new ChestMonitorHandler( ih ); diff --git a/tile/storage/TileIOPort.java b/tile/storage/TileIOPort.java index 4d160af54..8cc008f4f 100644 --- a/tile/storage/TileIOPort.java +++ b/tile/storage/TileIOPort.java @@ -42,7 +42,6 @@ import appeng.util.IConfigManagerHost; import appeng.util.InventoryAdaptor; import appeng.util.Platform; import appeng.util.inv.WrapperInventoryRange; -import appeng.util.item.ItemList; public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IConfigManagerHost, IGridTickable { @@ -302,7 +301,7 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC if ( src instanceof IMEMonitor ) myList = ((IMEMonitor) src).getStorageList(); else - myList = src.getAvailableItems( new ItemList( src.getChannel().type ) ); + myList = src.getAvailableItems( src.getChannel().createList() ); if ( fm == FullnessMode.EMPTY ) return myList.isEmpty(); @@ -341,7 +340,7 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC if ( src instanceof IMEMonitor ) myList = ((IMEMonitor) src).getStorageList(); else - myList = src.getAvailableItems( new ItemList( src.getChannel().type ) ); + myList = src.getAvailableItems( src.getChannel().createList() ); boolean didStuff; diff --git a/util/Platform.java b/util/Platform.java index 92317d707..8fcac522a 100644 --- a/util/Platform.java +++ b/util/Platform.java @@ -93,7 +93,6 @@ import appeng.me.helpers.AENetworkProxy; import appeng.server.AccessType; import appeng.util.item.AEItemStack; import appeng.util.item.AESharedNBT; -import appeng.util.item.ItemList; import appeng.util.item.OreHelper; import appeng.util.item.OreRefrence; import buildcraft.api.tools.IToolWrench;