Package net.minecraft.entity.player
Class PlayerInventory
java.lang.Object
net.minecraft.entity.player.PlayerInventory
- All Implemented Interfaces:
IClearable,IInventory,INameable
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal NonNullList<ItemStack>private ItemStackprivate final List<NonNullList<ItemStack>>final NonNullList<ItemStack>final NonNullList<ItemStack>final PlayerEntityintprivate int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanprivate intaddResource(int p_191973_1_, ItemStack p_191973_2_) private intaddResource(ItemStack p_70452_1_) voidintclearOrCountMatchingItems(Predicate<ItemStack> p_234564_1_, int p_234564_2_, IInventory p_234564_3_) booleanbooleanvoiddropAll()voidfillStackedContents(RecipeItemHelper p_201571_1_) intfindSlotMatchingItem(ItemStack p_184429_1_) intfindSlotMatchingUnusedItem(ItemStack p_194014_1_) getArmor(int p_70440_1_) intfloatgetDestroySpeed(BlockState p_184438_1_) intgetItem(int p_70301_1_) getName()static intintgetSlotWithRemainingSpace(ItemStack p_70432_1_) intintprivate booleanhasRemainingSpaceForItem(ItemStack p_184436_1_, ItemStack p_184436_2_) voidhurtArmor(DamageSource p_234563_1_, float p_234563_2_) booleanisEmpty()static booleanisHotbarSlot(int p_184435_0_) private booleanisSameItem(ItemStack p_184431_1_, ItemStack p_184431_2_) voidvoidpickSlot(int p_184430_1_) voidplaceItemBackInInventory(World p_191975_1_, ItemStack p_191975_2_) removeItem(int p_70298_1_, int p_70298_2_) voidremoveItem(ItemStack p_184437_1_) removeItemNoUpdate(int p_70304_1_) voidreplaceWith(PlayerInventory p_70455_1_) voidsetCarried(ItemStack p_70437_1_) voidvoidvoidsetPickedItem(ItemStack p_184434_1_) booleanstillValid(PlayerEntity p_70300_1_) voidswapPaint(double p_195409_1_) voidtick()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.inventory.IInventory
canPlaceItem, countItem, getMaxStackSize, hasAnyOf, startOpen, stopOpenMethods inherited from interface net.minecraft.util.INameable
getCustomName, getDisplayName, hasCustomName
-
Field Details
-
items
-
armor
-
offhand
-
compartments
-
selected
public int selected -
player
-
carried
-
timesChanged
private int timesChanged
-
-
Constructor Details
-
PlayerInventory
-
-
Method Details
-
getSelected
-
getSelectionSize
public static int getSelectionSize() -
hasRemainingSpaceForItem
-
isSameItem
-
getFreeSlot
public int getFreeSlot() -
setPickedItem
-
pickSlot
public void pickSlot(int p_184430_1_) -
isHotbarSlot
public static boolean isHotbarSlot(int p_184435_0_) -
findSlotMatchingItem
-
findSlotMatchingUnusedItem
-
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
-
addResource
-
getSlotWithRemainingSpace
-
tick
public void tick() -
add
-
add
-
placeItemBackInInventory
-
removeItem
- Specified by:
removeItemin interfaceIInventory
-
removeItem
-
removeItemNoUpdate
- Specified by:
removeItemNoUpdatein interfaceIInventory
-
setItem
- Specified by:
setItemin interfaceIInventory
-
getDestroySpeed
-
save
-
load
-
getContainerSize
public int getContainerSize()- Specified by:
getContainerSizein interfaceIInventory
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceIInventory
-
getItem
- Specified by:
getItemin interfaceIInventory
-
getName
-
getArmor
-
hurtArmor
-
dropAll
public void dropAll() -
setChanged
public void setChanged()- Specified by:
setChangedin interfaceIInventory
-
getTimesChanged
public int getTimesChanged() -
setCarried
-
getCarried
-
stillValid
- Specified by:
stillValidin interfaceIInventory
-
contains
-
contains
-
replaceWith
-
clearContent
public void clearContent()- Specified by:
clearContentin interfaceIClearable
-
fillStackedContents
-