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:
@@ -34,9 +34,9 @@ import appeng.api.config.SortOrder;
|
||||
import appeng.api.config.ViewItems;
|
||||
import appeng.api.implementations.tiles.IViewCellStorage;
|
||||
import appeng.api.storage.IMEMonitor;
|
||||
import appeng.api.storage.IStorageChannel;
|
||||
import appeng.api.storage.ITerminalHost;
|
||||
import appeng.api.storage.data.IAEFluidStack;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.api.storage.data.IAEStack;
|
||||
import appeng.api.util.IConfigManager;
|
||||
import appeng.core.sync.GuiBridge;
|
||||
import appeng.me.GridAccessException;
|
||||
@@ -136,25 +136,11 @@ public abstract class AbstractPartTerminal extends AbstractPartDisplay implement
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMEMonitor<IAEItemStack> getItemInventory()
|
||||
public <T extends IAEStack<T>> IMEMonitor<T> getInventory( IStorageChannel<T> channel )
|
||||
{
|
||||
try
|
||||
{
|
||||
return this.getProxy().getStorage().getItemInventory();
|
||||
}
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
// err nope?
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMEMonitor<IAEFluidStack> getFluidInventory()
|
||||
{
|
||||
try
|
||||
{
|
||||
return this.getProxy().getStorage().getFluidInventory();
|
||||
return this.getProxy().getStorage().getInventory( channel );
|
||||
}
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user