make it runnable

This commit is contained in:
thatsIch
2015-06-17 19:39:18 +02:00
parent 38afde724b
commit a95b9962b9
17 changed files with 1422 additions and 1583 deletions
+92 -105
View File
@@ -19,108 +19,95 @@
package appeng.util.inv;
import java.util.Iterator;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import appeng.api.config.FuzzyMode;
import appeng.api.util.ForgeDirection;
import appeng.integration.IntegrationRegistry;
import appeng.integration.IntegrationType;
import appeng.integration.abstraction.IBC;
import appeng.util.InventoryAdaptor;
import appeng.util.iterators.NullIterator;
public class AdaptorBCPipe extends InventoryAdaptor
{
private final IBC bc;
private final TileEntity i;
private final ForgeDirection d;
public AdaptorBCPipe( TileEntity s, ForgeDirection dd )
{
this.bc = (IBC) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.BC );
if( this.bc != null )
{
if( this.bc.isPipe( s, dd ) )
{
this.i = s;
this.d = dd;
return;
}
}
this.i = null;
this.d = null;
}
@Override
public ItemStack removeItems( int amount, ItemStack filter, IInventoryDestination destination )
{
return null;
}
@Override
public ItemStack simulateRemove( int amount, ItemStack filter, IInventoryDestination destination )
{
return null;
}
@Override
public ItemStack removeSimilarItems( int amount, ItemStack filter, FuzzyMode fuzzyMode, IInventoryDestination destination )
{
return null;
}
@Override
public ItemStack simulateSimilarRemove( int amount, ItemStack filter, FuzzyMode fuzzyMode, IInventoryDestination destination )
{
return null;
}
@Override
public ItemStack addItems( ItemStack toBeAdded )
{
if( this.i == null )
{
return toBeAdded;
}
if( toBeAdded == null )
{
return null;
}
if( toBeAdded.stackSize == 0 )
{
return null;
}
if( this.bc.addItemsToPipe( this.i, toBeAdded, this.d ) )
{
return null;
}
return toBeAdded;
}
@Override
public ItemStack simulateAdd( ItemStack toBeSimulated )
{
if( this.i == null )
{
return toBeSimulated;
}
return null;
}
@Override
public boolean containsItems()
{
return false;
}
@Override
public Iterator<ItemSlot> iterator()
{
return new NullIterator<ItemSlot>();
}
}
//public class AdaptorBCPipe extends InventoryAdaptor
//{
//
// private final IBC bc;
// private final TileEntity i;
// private final ForgeDirection d;
//
// public AdaptorBCPipe( TileEntity s, ForgeDirection dd )
// {
// this.bc = (IBC) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.BC );
// if( this.bc != null )
// {
// if( this.bc.isPipe( s, dd ) )
// {
// this.i = s;
// this.d = dd;
// return;
// }
// }
// this.i = null;
// this.d = null;
// }
//
// @Override
// public ItemStack removeItems( int amount, ItemStack filter, IInventoryDestination destination )
// {
// return null;
// }
//
// @Override
// public ItemStack simulateRemove( int amount, ItemStack filter, IInventoryDestination destination )
// {
// return null;
// }
//
// @Override
// public ItemStack removeSimilarItems( int amount, ItemStack filter, FuzzyMode fuzzyMode, IInventoryDestination destination )
// {
// return null;
// }
//
// @Override
// public ItemStack simulateSimilarRemove( int amount, ItemStack filter, FuzzyMode fuzzyMode, IInventoryDestination destination )
// {
// return null;
// }
//
// @Override
// public ItemStack addItems( ItemStack toBeAdded )
// {
// if( this.i == null )
// {
// return toBeAdded;
// }
// if( toBeAdded == null )
// {
// return null;
// }
// if( toBeAdded.stackSize == 0 )
// {
// return null;
// }
//
// if( this.bc.addItemsToPipe( this.i, toBeAdded, this.d ) )
// {
// return null;
// }
// return toBeAdded;
// }
//
// @Override
// public ItemStack simulateAdd( ItemStack toBeSimulated )
// {
// if( this.i == null )
// {
// return toBeSimulated;
// }
// return null;
// }
//
// @Override
// public boolean containsItems()
// {
// return false;
// }
//
// @Override
// public Iterator<ItemSlot> iterator()
// {
// return new NullIterator<ItemSlot>();
// }
//}