public class InventoryPlayer extends java.lang.Object implements IInventory
| Modifier and Type | Field and Description |
|---|---|
NonNullList<ItemStack> |
armorInventory |
int |
currentItem |
NonNullList<ItemStack> |
mainInventory |
NonNullList<ItemStack> |
offHandInventory |
EntityPlayer |
player |
| Constructor and Description |
|---|
InventoryPlayer(EntityPlayer playerIn) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetHeight, getWidthgetDisplayNamepublic final NonNullList<ItemStack> mainInventory
public final NonNullList<ItemStack> armorInventory
public final NonNullList<ItemStack> offHandInventory
public int currentItem
public EntityPlayer player
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 findSlotMatchingUnusedItem(ItemStack p_194014_1_)
public int getBestHotbarSlot()
public void changeCurrentItem(double direction)
public int clearMatchingItems(java.util.function.Predicate<ItemStack> p_195408_1_, int count)
public int storeItemStack(ItemStack itemStackIn)
public void tick()
public boolean addItemStackToInventory(ItemStack itemStackIn)
public boolean add(int p_191971_1_,
ItemStack p_191971_2_)
public void placeItemBackInInventory(World p_191975_1_, ItemStack p_191975_2_)
public ItemStack decrStackSize(int index, int count)
decrStackSize in interface IInventorypublic void deleteStack(ItemStack stack)
public ItemStack removeStackFromSlot(int index)
removeStackFromSlot in interface IInventorypublic void setInventorySlotContents(int index,
ItemStack stack)
setInventorySlotContents in interface IInventorypublic float getDestroySpeed(IBlockState state)
public NBTTagList write(NBTTagList nbtTagListIn)
public void read(NBTTagList nbtTagListIn)
public int getSizeInventory()
getSizeInventory in interface IInventorypublic boolean isEmpty()
isEmpty in interface IInventorypublic ItemStack getStackInSlot(int index)
getStackInSlot in interface IInventorypublic ITextComponent getName()
@Nullable public ITextComponent getCustomName()
getCustomName in interface INameablepublic boolean hasCustomName()
hasCustomName in interface INameablepublic 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 int getTimesChanged()
public void setItemStack(ItemStack itemStackIn)
public ItemStack getItemStack()
public boolean isUsableByPlayer(EntityPlayer player)
isUsableByPlayer 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 IInventorypublic void func_201571_a(RecipeItemHelper p_201571_1_)