Class PlayerInventory

java.lang.Object
net.minecraft.entity.player.PlayerInventory
All Implemented Interfaces:
IClearable, IInventory, INameable

public class PlayerInventory extends Object implements IInventory, INameable
  • Field Details

  • Constructor Details

    • PlayerInventory

      public PlayerInventory(PlayerEntity p_i1750_1_)
  • Method Details

    • getSelected

      public ItemStack getSelected()
    • getSelectionSize

      public static int getSelectionSize()
    • hasRemainingSpaceForItem

      private boolean hasRemainingSpaceForItem(ItemStack p_184436_1_, ItemStack p_184436_2_)
    • isSameItem

      private boolean isSameItem(ItemStack p_184431_1_, ItemStack p_184431_2_)
    • getFreeSlot

      public int getFreeSlot()
    • setPickedItem

      public void setPickedItem(ItemStack p_184434_1_)
    • pickSlot

      public void pickSlot(int p_184430_1_)
    • isHotbarSlot

      public static boolean isHotbarSlot(int p_184435_0_)
    • findSlotMatchingItem

      public int findSlotMatchingItem(ItemStack p_184429_1_)
    • findSlotMatchingUnusedItem

      public int findSlotMatchingUnusedItem(ItemStack p_194014_1_)
    • getSuitableHotbarSlot

      public int getSuitableHotbarSlot()
    • swapPaint

      public void swapPaint(double p_195409_1_)
    • clearOrCountMatchingItems

      public int clearOrCountMatchingItems(Predicate<ItemStack> p_234564_1_, int p_234564_2_, IInventory p_234564_3_)
    • addResource

      private int addResource(ItemStack p_70452_1_)
    • addResource

      private int addResource(int p_191973_1_, ItemStack p_191973_2_)
    • getSlotWithRemainingSpace

      public int getSlotWithRemainingSpace(ItemStack p_70432_1_)
    • tick

      public void tick()
    • add

      public boolean add(ItemStack p_70441_1_)
    • add

      public boolean add(int p_191971_1_, ItemStack p_191971_2_)
    • placeItemBackInInventory

      public void placeItemBackInInventory(World p_191975_1_, ItemStack p_191975_2_)
    • removeItem

      public ItemStack removeItem(int p_70298_1_, int p_70298_2_)
      Specified by:
      removeItem in interface IInventory
    • removeItem

      public void removeItem(ItemStack p_184437_1_)
    • removeItemNoUpdate

      public ItemStack removeItemNoUpdate(int p_70304_1_)
      Specified by:
      removeItemNoUpdate in interface IInventory
    • setItem

      public void setItem(int p_70299_1_, ItemStack p_70299_2_)
      Specified by:
      setItem in interface IInventory
    • getDestroySpeed

      public float getDestroySpeed(BlockState p_184438_1_)
    • save

      public ListNBT save(ListNBT p_70442_1_)
    • load

      public void load(ListNBT p_70443_1_)
    • getContainerSize

      public int getContainerSize()
      Specified by:
      getContainerSize in interface IInventory
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface IInventory
    • getItem

      public ItemStack getItem(int p_70301_1_)
      Specified by:
      getItem in interface IInventory
    • getName

      public ITextComponent getName()
      Specified by:
      getName in interface INameable
    • getArmor

      public ItemStack getArmor(int p_70440_1_)
    • hurtArmor

      public void hurtArmor(DamageSource p_234563_1_, float p_234563_2_)
    • dropAll

      public void dropAll()
    • setChanged

      public void setChanged()
      Specified by:
      setChanged in interface IInventory
    • getTimesChanged

      public int getTimesChanged()
    • setCarried

      public void setCarried(ItemStack p_70437_1_)
    • getCarried

      public ItemStack getCarried()
    • stillValid

      public boolean stillValid(PlayerEntity p_70300_1_)
      Specified by:
      stillValid in interface IInventory
    • contains

      public boolean contains(ItemStack p_70431_1_)
    • contains

      public boolean contains(ITag<Item> p_199712_1_)
    • replaceWith

      public void replaceWith(PlayerInventory p_70455_1_)
    • clearContent

      public void clearContent()
      Specified by:
      clearContent in interface IClearable
    • fillStackedContents

      public void fillStackedContents(RecipeItemHelper p_201571_1_)