2013-12-27 23:59:59 +01:00
|
|
|
package appeng.me.storage;
|
|
|
|
|
|
|
|
import appeng.api.config.AccessRestriction;
|
|
|
|
import appeng.api.config.Actionable;
|
2014-01-20 17:41:37 +01:00
|
|
|
import appeng.api.networking.security.BaseActionSource;
|
2013-12-27 23:59:59 +01:00
|
|
|
import appeng.api.storage.IMEInventory;
|
|
|
|
import appeng.api.storage.IMEInventoryHandler;
|
|
|
|
import appeng.api.storage.StorageChannel;
|
|
|
|
import appeng.api.storage.data.IAEStack;
|
|
|
|
import appeng.api.storage.data.IItemList;
|
|
|
|
|
|
|
|
public class MEPassthru<T extends IAEStack<T>> implements IMEInventoryHandler<T>
|
|
|
|
{
|
|
|
|
|
|
|
|
private IMEInventory<T> internal;
|
2014-07-24 06:20:16 +02:00
|
|
|
final protected StorageChannel channel;
|
2013-12-27 23:59:59 +01:00
|
|
|
|
|
|
|
protected IMEInventory<T> getInternal()
|
|
|
|
{
|
|
|
|
return internal;
|
|
|
|
}
|
|
|
|
|
2014-07-24 06:20:16 +02:00
|
|
|
public MEPassthru(IMEInventory<T> i, StorageChannel channel) {
|
|
|
|
this.channel = channel;
|
2013-12-27 23:59:59 +01:00
|
|
|
setInternal( i );
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setInternal(IMEInventory<T> i)
|
|
|
|
{
|
|
|
|
internal = i;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2014-01-20 17:41:37 +01:00
|
|
|
public T injectItems(T input, Actionable type, BaseActionSource src)
|
2013-12-27 23:59:59 +01:00
|
|
|
{
|
2014-01-20 17:41:37 +01:00
|
|
|
return internal.injectItems( input, type, src );
|
2013-12-27 23:59:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2014-01-20 17:41:37 +01:00
|
|
|
public T extractItems(T request, Actionable type, BaseActionSource src)
|
2013-12-27 23:59:59 +01:00
|
|
|
{
|
2014-01-20 17:41:37 +01:00
|
|
|
return internal.extractItems( request, type, src );
|
2013-12-27 23:59:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public IItemList<T> getAvailableItems(IItemList out)
|
|
|
|
{
|
|
|
|
return internal.getAvailableItems( out );
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public StorageChannel getChannel()
|
|
|
|
{
|
|
|
|
return internal.getChannel();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public AccessRestriction getAccess()
|
|
|
|
{
|
|
|
|
return AccessRestriction.READ_WRITE;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean isPrioritized(T input)
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean canAccept(T input)
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public int getPriority()
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public int getSlot()
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2014-06-20 09:10:02 +02:00
|
|
|
@Override
|
|
|
|
public boolean validForPass(int i)
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2013-12-27 23:59:59 +01:00
|
|
|
}
|