2013-12-27 23:59:59 +01:00
|
|
|
package appeng.integration.modules.helpers;
|
|
|
|
|
|
|
|
import net.minecraft.tileentity.TileEntity;
|
2014-02-09 02:34:52 +01:00
|
|
|
import net.minecraftforge.common.util.ForgeDirection;
|
2013-12-27 23:59:59 +01:00
|
|
|
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.StorageChannel;
|
|
|
|
import appeng.api.storage.data.IAEItemStack;
|
|
|
|
import appeng.api.storage.data.IItemList;
|
|
|
|
import appeng.integration.modules.BC;
|
|
|
|
|
|
|
|
public class BCPipeInventory implements IMEInventory<IAEItemStack>
|
|
|
|
{
|
|
|
|
|
|
|
|
TileEntity te;
|
|
|
|
ForgeDirection dir;
|
|
|
|
|
|
|
|
public BCPipeInventory(TileEntity _te, ForgeDirection _dir) {
|
|
|
|
te = _te;
|
|
|
|
dir = _dir;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public StorageChannel getChannel()
|
|
|
|
{
|
|
|
|
return StorageChannel.ITEMS;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2014-01-20 17:41:37 +01:00
|
|
|
public IAEItemStack injectItems(IAEItemStack input, Actionable mode, BaseActionSource src)
|
2013-12-27 23:59:59 +01:00
|
|
|
{
|
|
|
|
if ( mode == Actionable.SIMULATE )
|
|
|
|
{
|
|
|
|
if ( BC.instance.canAddItemsToPipe( te, input.getItemStack(), dir ) )
|
|
|
|
return null;
|
|
|
|
return input;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( BC.instance.addItemsToPipe( te, input.getItemStack(), dir ) )
|
|
|
|
return null;
|
|
|
|
return input;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2014-01-20 17:41:37 +01:00
|
|
|
public IAEItemStack extractItems(IAEItemStack request, Actionable mode, BaseActionSource src)
|
2013-12-27 23:59:59 +01:00
|
|
|
{
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public IItemList<IAEItemStack> getAvailableItems(IItemList out)
|
|
|
|
{
|
|
|
|
return out;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|