make it runnable
This commit is contained in:
@@ -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>();
|
||||
// }
|
||||
//}
|
||||
|
||||
@@ -19,105 +19,95 @@
|
||||
package appeng.util.inv;
|
||||
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import appeng.api.util.ForgeDirection;
|
||||
import appeng.integration.IntegrationRegistry;
|
||||
import appeng.integration.IntegrationType;
|
||||
import appeng.integration.abstraction.IBC;
|
||||
|
||||
|
||||
public class WrapperBCPipe implements IInventory
|
||||
{
|
||||
|
||||
private final IBC bc;
|
||||
private final TileEntity ad;
|
||||
private final ForgeDirection dir;
|
||||
|
||||
public WrapperBCPipe( TileEntity te, ForgeDirection d )
|
||||
{
|
||||
this.bc = (IBC) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.BC );
|
||||
this.ad = te;
|
||||
this.dir = d;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSizeInventory()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlot( int i )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack decrStackSize( int i, int j )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlotOnClosing( int i )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInventorySlotContents( int i, ItemStack itemstack )
|
||||
{
|
||||
this.bc.addItemsToPipe( this.ad, itemstack, this.dir );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInventoryName()
|
||||
{
|
||||
return "BC Pipe Wrapper";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasCustomInventoryName()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInventoryStackLimit()
|
||||
{
|
||||
return 64;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void markDirty()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUseableByPlayer( EntityPlayer entityplayer )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openInventory()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void closeInventory()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot( int i, ItemStack itemstack )
|
||||
{
|
||||
return this.bc.canAddItemsToPipe( this.ad, itemstack, this.dir );
|
||||
}
|
||||
}
|
||||
//public class WrapperBCPipe implements IInventory
|
||||
//{
|
||||
//
|
||||
// private final IBC bc;
|
||||
// private final TileEntity ad;
|
||||
// private final ForgeDirection dir;
|
||||
//
|
||||
// public WrapperBCPipe( TileEntity te, ForgeDirection d )
|
||||
// {
|
||||
// this.bc = (IBC) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.BC );
|
||||
// this.ad = te;
|
||||
// this.dir = d;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public int getSizeInventory()
|
||||
// {
|
||||
// return 1;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public ItemStack getStackInSlot( int i )
|
||||
// {
|
||||
// return null;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public ItemStack decrStackSize( int i, int j )
|
||||
// {
|
||||
// return null;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public ItemStack getStackInSlotOnClosing( int i )
|
||||
// {
|
||||
// return null;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void setInventorySlotContents( int i, ItemStack itemstack )
|
||||
// {
|
||||
// this.bc.addItemsToPipe( this.ad, itemstack, this.dir );
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public String getInventoryName()
|
||||
// {
|
||||
// return "BC Pipe Wrapper";
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public boolean hasCustomInventoryName()
|
||||
// {
|
||||
// return false;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public int getInventoryStackLimit()
|
||||
// {
|
||||
// return 64;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void markDirty()
|
||||
// {
|
||||
//
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public boolean isUseableByPlayer( EntityPlayer entityplayer )
|
||||
// {
|
||||
// return false;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void openInventory()
|
||||
// {
|
||||
//
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void closeInventory()
|
||||
// {
|
||||
//
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public boolean isItemValidForSlot( int i, ItemStack itemstack )
|
||||
// {
|
||||
// return this.bc.canAddItemsToPipe( this.ad, itemstack, this.dir );
|
||||
// }
|
||||
//}
|
||||
|
||||
@@ -19,100 +19,93 @@
|
||||
package appeng.util.inv;
|
||||
|
||||
|
||||
import appeng.api.util.ForgeDirection;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
|
||||
public class WrapperTEPipe implements IInventory
|
||||
{
|
||||
|
||||
final TileEntity ad;
|
||||
final ForgeDirection dir;
|
||||
|
||||
public WrapperTEPipe( TileEntity te, ForgeDirection d )
|
||||
{
|
||||
this.ad = te;
|
||||
this.dir = d;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSizeInventory()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlot( int i )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack decrStackSize( int i, int j )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlotOnClosing( int i )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInventorySlotContents( int i, ItemStack itemstack )
|
||||
{
|
||||
// ITE.addItemsToPipe( ad, itemstack, dir );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInventoryName()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasCustomInventoryName()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInventoryStackLimit()
|
||||
{
|
||||
return 64;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void markDirty()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUseableByPlayer( EntityPlayer entityplayer )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openInventory()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void closeInventory()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot( int i, ItemStack itemstack )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
//public class WrapperTEPipe implements IInventory
|
||||
//{
|
||||
//
|
||||
// final TileEntity ad;
|
||||
// final ForgeDirection dir;
|
||||
//
|
||||
// public WrapperTEPipe( TileEntity te, ForgeDirection d )
|
||||
// {
|
||||
// this.ad = te;
|
||||
// this.dir = d;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public int getSizeInventory()
|
||||
// {
|
||||
// return 1;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public ItemStack getStackInSlot( int i )
|
||||
// {
|
||||
// return null;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public ItemStack decrStackSize( int i, int j )
|
||||
// {
|
||||
// return null;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public ItemStack getStackInSlotOnClosing( int i )
|
||||
// {
|
||||
// return null;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void setInventorySlotContents( int i, ItemStack itemstack )
|
||||
// {
|
||||
// // ITE.addItemsToPipe( ad, itemstack, dir );
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public String getInventoryName()
|
||||
// {
|
||||
// return null;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public boolean hasCustomInventoryName()
|
||||
// {
|
||||
// return false;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public int getInventoryStackLimit()
|
||||
// {
|
||||
// return 64;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void markDirty()
|
||||
// {
|
||||
//
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public boolean isUseableByPlayer( EntityPlayer entityplayer )
|
||||
// {
|
||||
// return false;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void openInventory()
|
||||
// {
|
||||
//
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void closeInventory()
|
||||
// {
|
||||
//
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public boolean isItemValidForSlot( int i, ItemStack itemstack )
|
||||
// {
|
||||
// return false;
|
||||
// }
|
||||
//}
|
||||
|
||||
Reference in New Issue
Block a user