Package net.minecraft.entity.player
Class PlayerInventory
java.lang.Object
net.minecraft.entity.player.PlayerInventory
- All Implemented Interfaces:
IClearable
,IInventory
,INameable
-
Field Summary
Modifier and TypeFieldDescriptionfinal NonNullList<ItemStack>
private ItemStack
private final List<NonNullList<ItemStack>>
final NonNullList<ItemStack>
final NonNullList<ItemStack>
final PlayerEntity
int
private int
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
private int
addResource
(int p_191973_1_, ItemStack p_191973_2_) private int
addResource
(ItemStack p_70452_1_) void
int
clearOrCountMatchingItems
(Predicate<ItemStack> p_234564_1_, int p_234564_2_, IInventory p_234564_3_) boolean
boolean
void
dropAll()
void
fillStackedContents
(RecipeItemHelper p_201571_1_) int
findSlotMatchingItem
(ItemStack p_184429_1_) int
findSlotMatchingUnusedItem
(ItemStack p_194014_1_) getArmor
(int p_70440_1_) int
float
getDestroySpeed
(BlockState p_184438_1_) int
getItem
(int p_70301_1_) getName()
static int
int
getSlotWithRemainingSpace
(ItemStack p_70432_1_) int
int
private boolean
hasRemainingSpaceForItem
(ItemStack p_184436_1_, ItemStack p_184436_2_) void
hurtArmor
(DamageSource p_234563_1_, float p_234563_2_) boolean
isEmpty()
static boolean
isHotbarSlot
(int p_184435_0_) private boolean
isSameItem
(ItemStack p_184431_1_, ItemStack p_184431_2_) void
void
pickSlot
(int p_184430_1_) void
placeItemBackInInventory
(World p_191975_1_, ItemStack p_191975_2_) removeItem
(int p_70298_1_, int p_70298_2_) void
removeItem
(ItemStack p_184437_1_) removeItemNoUpdate
(int p_70304_1_) void
replaceWith
(PlayerInventory p_70455_1_) void
setCarried
(ItemStack p_70437_1_) void
void
void
setPickedItem
(ItemStack p_184434_1_) boolean
stillValid
(PlayerEntity p_70300_1_) void
swapPaint
(double p_195409_1_) void
tick()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minecraft.inventory.IInventory
canPlaceItem, countItem, getMaxStackSize, hasAnyOf, startOpen, stopOpen
Methods 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:
removeItem
in interfaceIInventory
-
removeItem
-
removeItemNoUpdate
- Specified by:
removeItemNoUpdate
in interfaceIInventory
-
setItem
- Specified by:
setItem
in interfaceIInventory
-
getDestroySpeed
-
save
-
load
-
getContainerSize
public int getContainerSize()- Specified by:
getContainerSize
in interfaceIInventory
-
isEmpty
public boolean isEmpty()- Specified by:
isEmpty
in interfaceIInventory
-
getItem
- Specified by:
getItem
in interfaceIInventory
-
getName
-
getArmor
-
hurtArmor
-
dropAll
public void dropAll() -
setChanged
public void setChanged()- Specified by:
setChanged
in interfaceIInventory
-
getTimesChanged
public int getTimesChanged() -
setCarried
-
getCarried
-
stillValid
- Specified by:
stillValid
in interfaceIInventory
-
contains
-
contains
-
replaceWith
-
clearContent
public void clearContent()- Specified by:
clearContent
in interfaceIClearable
-
fillStackedContents
-