public class InventoryPlayer extends java.lang.Object implements IInventory
| Modifier and Type | Field and Description |
|---|---|
ItemStack[] |
armorInventory |
int |
currentItem |
boolean |
inventoryChanged |
ItemStack[] |
mainInventory |
ItemStack[] |
offHandInventory |
EntityPlayer |
player |
| Constructor and Description |
|---|
InventoryPlayer(EntityPlayer playerIn) |
public final ItemStack[] mainInventory
public final ItemStack[] armorInventory
public final ItemStack[] offHandInventory
public int currentItem
public EntityPlayer player
public boolean inventoryChanged
public InventoryPlayer(EntityPlayer playerIn)
@Nullable 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(@Nullable
ItemStack itemStackIn)
@Nullable public ItemStack decrStackSize(int index, int count)
decrStackSize in interface IInventorypublic void deleteStack(ItemStack stack)
@Nullable public ItemStack removeStackFromSlot(int index)
removeStackFromSlot in interface IInventorypublic void setInventorySlotContents(int index,
@Nullable
ItemStack stack)
setInventorySlotContents in interface IInventorypublic float getStrVsBlock(IBlockState state)
public NBTTagList writeToNBT(NBTTagList nbtTagListIn)
public void readFromNBT(NBTTagList nbtTagListIn)
public int getSizeInventory()
getSizeInventory in interface IInventory@Nullable public ItemStack getStackInSlot(int index)
getStackInSlot in interface IInventorypublic java.lang.String getName()
getName in interface IWorldNameablepublic boolean hasCustomName()
hasCustomName in interface IWorldNameablepublic ITextComponent getDisplayName()
getDisplayName in interface IWorldNameablepublic int getInventoryStackLimit()
getInventoryStackLimit in interface IInventorypublic boolean canHarvestBlock(IBlockState state)
public ItemStack armorItemInSlot(int slotIn)
public void damageArmor(float damage)
public void dropAllItems()
public void markDirty()
markDirty in interface IInventorypublic void setItemStack(@Nullable
ItemStack itemStackIn)
@Nullable public ItemStack getItemStack()
public boolean isUseableByPlayer(EntityPlayer player)
isUseableByPlayer in interface IInventorypublic boolean hasItemStack(ItemStack itemStackIn)
public void openInventory(EntityPlayer player)
openInventory in interface IInventorypublic void closeInventory(EntityPlayer player)
closeInventory in interface IInventorypublic boolean isItemValidForSlot(int index,
ItemStack stack)
isItemValidForSlot in interface IInventorypublic void copyInventory(InventoryPlayer playerInventory)
public int getField(int id)
getField in interface IInventorypublic void setField(int id,
int value)
setField in interface IInventorypublic int getFieldCount()
getFieldCount in interface IInventorypublic void clear()
clear in interface IInventory