2013-12-27 23:59:59 +01:00
|
|
|
package appeng.util.inv;
|
|
|
|
|
|
|
|
import java.util.Iterator;
|
|
|
|
|
|
|
|
import net.minecraft.item.ItemStack;
|
|
|
|
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.FuzzyMode;
|
2014-02-09 02:34:52 +01:00
|
|
|
import appeng.core.AppEng;
|
|
|
|
import appeng.integration.abstraction.IBC;
|
2013-12-27 23:59:59 +01:00
|
|
|
import appeng.util.InventoryAdaptor;
|
|
|
|
import appeng.util.iterators.NullIterator;
|
|
|
|
|
|
|
|
public class AdaptorBCPipe extends InventoryAdaptor
|
|
|
|
{
|
|
|
|
|
2014-02-09 02:34:52 +01:00
|
|
|
final private IBC bc;
|
|
|
|
final private TileEntity i;
|
|
|
|
final private ForgeDirection d;
|
2013-12-27 23:59:59 +01:00
|
|
|
|
|
|
|
public AdaptorBCPipe(TileEntity s, ForgeDirection dd) {
|
2014-02-09 02:34:52 +01:00
|
|
|
bc = (IBC) AppEng.instance.getIntegration( "BC" );
|
|
|
|
if ( bc != null )
|
2013-12-27 23:59:59 +01:00
|
|
|
{
|
2014-02-09 02:34:52 +01:00
|
|
|
if ( bc.isPipe( s, dd ) )
|
2013-12-27 23:59:59 +01:00
|
|
|
{
|
|
|
|
i = s;
|
|
|
|
d = dd;
|
2014-02-09 02:34:52 +01:00
|
|
|
return;
|
2013-12-27 23:59:59 +01:00
|
|
|
}
|
|
|
|
}
|
2014-02-09 02:34:52 +01:00
|
|
|
i = null;
|
|
|
|
d = null;
|
2013-12-27 23:59:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public ItemStack removeSimilarItems(int amount, ItemStack filter, FuzzyMode fuzzyMode, IInventoryDestination destination)
|
|
|
|
{
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public ItemStack simulateSimilarRemove(int how_many, ItemStack filter, FuzzyMode fuzzyMode, IInventoryDestination destination)
|
|
|
|
{
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public ItemStack removeItems(int how_many, ItemStack filter, IInventoryDestination destination)
|
|
|
|
{
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public ItemStack simulateRemove(int how_many, ItemStack filter, IInventoryDestination destination)
|
|
|
|
{
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public ItemStack addItems(ItemStack A)
|
|
|
|
{
|
|
|
|
if ( i == null )
|
|
|
|
return A;
|
|
|
|
if ( A == null )
|
|
|
|
return null;
|
|
|
|
if ( A.stackSize == 0 )
|
|
|
|
return null;
|
|
|
|
|
2014-02-09 02:34:52 +01:00
|
|
|
if ( bc.addItemsToPipe( i, A, d ) )
|
2013-12-27 23:59:59 +01:00
|
|
|
return null;
|
|
|
|
return A;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public ItemStack simulateAdd(ItemStack A)
|
|
|
|
{
|
|
|
|
if ( i == null )
|
|
|
|
return A;
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean containsItems()
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public Iterator<ItemSlot> iterator()
|
|
|
|
{
|
|
|
|
return new NullIterator();
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|