Applied-Energistics-2-tiler.../util/inv/AdaptorPlayerInventory.java

100 lines
1.7 KiB
Java
Raw Normal View History

package appeng.util.inv;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
public class AdaptorPlayerInventory implements IInventory
{
private InventoryPlayer src;
private int min;
private int size;
public AdaptorPlayerInventory(InventoryPlayer a) {
src = a;
min = 0; // a.getStartInventorySide( d );
size = 36; // a.getSizeInventorySide( d );
}
@Override
public int getSizeInventory()
{
return size;
}
@Override
public ItemStack getStackInSlot(int var1)
{
return src.getStackInSlot( var1 + min );
}
@Override
public ItemStack decrStackSize(int var1, int var2)
{
return src.decrStackSize( min + var1, var2 );
}
@Override
public ItemStack getStackInSlotOnClosing(int var1)
{
return src.getStackInSlotOnClosing( min + var1 );
}
@Override
public void setInventorySlotContents(int var1, ItemStack var2)
{
src.setInventorySlotContents( var1 + min, var2 );
}
@Override
2014-02-09 02:34:52 +01:00
public String getInventoryName()
{
2014-02-09 02:34:52 +01:00
return src.getInventoryName();
}
@Override
public int getInventoryStackLimit()
{
return src.getInventoryStackLimit();
}
@Override
2014-02-09 02:34:52 +01:00
public void markDirty()
{
2014-02-09 02:34:52 +01:00
src.markDirty();
}
@Override
public boolean isUseableByPlayer(EntityPlayer var1)
{
return src.isUseableByPlayer( var1 );
}
@Override
2014-02-09 02:34:52 +01:00
public void openInventory()
{
2014-02-09 02:34:52 +01:00
src.openInventory();
}
@Override
2014-02-09 02:34:52 +01:00
public void closeInventory()
{
2014-02-09 02:34:52 +01:00
src.closeInventory();
}
@Override
2014-02-09 02:34:52 +01:00
public boolean hasCustomInventoryName()
{
return false;
}
@Override
public boolean isItemValidForSlot(int i, ItemStack itemstack)
{
return true;
}
}