public class InventoryPlayer extends java.lang.Object implements IInventory
Modifier and Type | Field and Description |
---|---|
NonNullList<ItemStack> |
armorInventory |
int |
currentItem |
boolean |
inventoryChanged |
NonNullList<ItemStack> |
mainInventory |
NonNullList<ItemStack> |
offHandInventory |
EntityPlayer |
player |
Constructor and Description |
---|
InventoryPlayer(EntityPlayer playerIn) |
public final NonNullList<ItemStack> mainInventory
public final NonNullList<ItemStack> armorInventory
public final NonNullList<ItemStack> offHandInventory
public int currentItem
public EntityPlayer player
public boolean inventoryChanged
public InventoryPlayer(EntityPlayer playerIn)
public ItemStack getCurrentItem()
public static int getHotbarSize()
public int getFirstEmptyStack()
public void setPickedItemStack(ItemStack stack)
public void pickItem(int index)
public static boolean isHotbar(int index)
public int getSlotFor(ItemStack stack)
public int getBestHotbarSlot()
public void changeCurrentItem(int direction)
public int clearMatchingItems(@Nullable Item itemIn, int metadataIn, int removeCount, @Nullable NBTTagCompound itemNBT)
public void decrementAnimations()
public boolean addItemStackToInventory(ItemStack itemStackIn)
public ItemStack decrStackSize(int index, int count)
decrStackSize
in interface IInventory
public void deleteStack(ItemStack stack)
public ItemStack removeStackFromSlot(int index)
removeStackFromSlot
in interface IInventory
public void setInventorySlotContents(int index, ItemStack stack)
setInventorySlotContents
in interface IInventory
public float getStrVsBlock(IBlockState state)
public NBTTagList writeToNBT(NBTTagList nbtTagListIn)
public void readFromNBT(NBTTagList nbtTagListIn)
public int getSizeInventory()
getSizeInventory
in interface IInventory
public boolean isEmpty()
isEmpty
in interface IInventory
public ItemStack getStackInSlot(int index)
getStackInSlot
in interface IInventory
public java.lang.String getName()
getName
in interface IWorldNameable
public boolean hasCustomName()
hasCustomName
in interface IWorldNameable
public ITextComponent getDisplayName()
getDisplayName
in interface IWorldNameable
public int getInventoryStackLimit()
getInventoryStackLimit
in interface IInventory
public boolean canHarvestBlock(IBlockState state)
public ItemStack armorItemInSlot(int slotIn)
public void damageArmor(float damage)
public void dropAllItems()
public void markDirty()
markDirty
in interface IInventory
public void setItemStack(ItemStack itemStackIn)
public ItemStack getItemStack()
public boolean isUsableByPlayer(EntityPlayer player)
isUsableByPlayer
in interface IInventory
public boolean hasItemStack(ItemStack itemStackIn)
public void openInventory(EntityPlayer player)
openInventory
in interface IInventory
public void closeInventory(EntityPlayer player)
closeInventory
in interface IInventory
public boolean isItemValidForSlot(int index, ItemStack stack)
isItemValidForSlot
in interface IInventory
public void copyInventory(InventoryPlayer playerInventory)
public int getField(int id)
getField
in interface IInventory
public void setField(int id, int value)
setField
in interface IInventory
public int getFieldCount()
getFieldCount
in interface IInventory
public void clear()
clear
in interface IInventory