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
@@ -54,6 +54,7 @@ import appeng.api.parts.IPart;
import appeng.api.storage.IMEMonitor;
import appeng.api.storage.IMEMonitorHandlerReceiver;
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.api.util.AEPartLocation;
@@ -77,7 +78,7 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa
private final SlotRestrictedInput[] cellView = new SlotRestrictedInput[5];
private final IMEMonitor<IAEItemStack> monitor;
private final IItemList<IAEItemStack> items = AEApi.instance().storage().createItemList();
private final IItemList<IAEItemStack> items = AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ).createList();
private final IConfigManager clientCM;
private final ITerminalHost host;
@GuiSync( 99 )
@@ -108,7 +109,7 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa
{
this.serverCM = monitorable.getConfigManager();
this.monitor = monitorable.getItemInventory();
this.monitor = monitorable.getInventory( AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ) );
if( this.monitor != null )
{
this.monitor.addListener( this, null );
@@ -188,7 +189,7 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa
{
if( Platform.isServer() )
{
if( this.monitor != this.host.getItemInventory() )
if( this.monitor != this.host.getInventory( AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ) ) )
{
this.setValidContainer( false );
}