Refactored StorageChannel enum into an interface (#3138)

This replaces the static enum with a more dynamic interface providing
factory methods for handling network storage.
This commit is contained in:
yueh
2017-10-08 17:59:30 +02:00
committed by GitHub
parent 8ad8ce68b5
commit 6e81f698c0
115 changed files with 1255 additions and 943 deletions
@@ -45,6 +45,7 @@ import appeng.api.config.Actionable;
import appeng.api.definitions.IDefinitions;
import appeng.api.storage.IMEMonitor;
import appeng.api.storage.ITerminalHost;
import appeng.api.storage.channels.IItemStorageChannel;
import appeng.api.storage.data.IAEItemStack;
import appeng.api.storage.data.IItemList;
import appeng.container.ContainerNull;
@@ -398,7 +399,8 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA
return;
}
final IMEMonitor<IAEItemStack> storage = this.getPatternTerminal().getItemInventory();
final IMEMonitor<IAEItemStack> storage = this.getPatternTerminal()
.getInventory( AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ) );
final IItemList<IAEItemStack> all = storage.getStorageList();
final ItemStack is = r.getCraftingResult( ic );
@@ -447,7 +449,7 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA
final ItemStack failed = real.getStackInSlot( x );
if( !failed.isEmpty() )
{
this.getCellInventory().injectItems( AEItemStack.create( failed ), Actionable.MODULATE,
this.getCellInventory().injectItems( AEItemStack.fromItemStack( failed ), Actionable.MODULATE,
new MachineSource( this.getPatternTerminal() ) );
}
}