Class Inventory
java.lang.Object
net.minecraft.world.entity.player.Inventory
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.world.Container
Container.ContainerIterator
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final EntityEquipment
static final it.unimi.dsi.fastutil.ints.Int2ObjectMap
<EquipmentSlot> static final int
private final NonNullList
<ItemStack> static final int
final Player
static final int
private int
static final int
static final int
private int
Fields inherited from interface net.minecraft.world.Container
DEFAULT_DISTANCE_BUFFER
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
void
addAndPickItem
(ItemStack p_383009_) private int
addResource
(int p_36048_, ItemStack p_36049_) private int
addResource
(ItemStack p_36067_) void
int
clearOrCountMatchingItems
(Predicate<ItemStack> p_36023_, int p_36024_, Container p_36025_) boolean
boolean
boolean
createInventoryUpdatePacket
(int p_365327_) void
dropAll()
void
fillStackedContents
(StackedItemContents p_360737_) int
findSlotMatchingCraftingIngredient
(Holder<Item> p_363103_, ItemStack p_390604_) int
findSlotMatchingItem
(ItemStack p_36031_) int
int
getItem
(int p_35991_) getName()
int
static int
int
getSlotWithRemainingSpace
(ItemStack p_36051_) int
int
private boolean
hasRemainingSpaceForItem
(ItemStack p_36015_, ItemStack p_36016_) boolean
isEmpty()
static boolean
isHotbarSlot
(int p_36046_) static boolean
isUsableForCrafting
(ItemStack p_365004_) void
void
pickSlot
(int p_36039_) void
placeItemBackInInventory
(ItemStack p_150080_) void
placeItemBackInInventory
(ItemStack p_150077_, boolean p_150078_) removeFromSelected
(boolean p_182404_) removeItem
(int p_35993_, int p_35994_) void
removeItem
(ItemStack p_36058_) removeItemNoUpdate
(int p_36029_) void
replaceWith
(Inventory p_36007_) void
void
setSelectedItem
(ItemStack p_401838_) void
setSelectedSlot
(int p_401904_) boolean
stillValid
(Player p_36009_) 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.world.Container
canPlaceItem, canTakeItem, countItem, getMaxStackSize, getMaxStackSize, hasAnyMatching, hasAnyOf, iterator, startOpen, stopOpen
Methods inherited from interface java.lang.Iterable
forEach, spliterator
Methods inherited from interface net.minecraft.world.Nameable
getCustomName, getDisplayName, hasCustomName
-
Field Details
-
POP_TIME_DURATION
public static final int POP_TIME_DURATION- See Also:
-
INVENTORY_SIZE
public static final int INVENTORY_SIZE- See Also:
-
SELECTION_SIZE
public static final int SELECTION_SIZE- See Also:
-
SLOT_OFFHAND
public static final int SLOT_OFFHAND- See Also:
-
NOT_FOUND_INDEX
public static final int NOT_FOUND_INDEX- See Also:
-
EQUIPMENT_SLOT_MAPPING
-
items
-
selected
private int selected -
player
-
equipment
-
timesChanged
private int timesChanged
-
-
Constructor Details
-
Inventory
-
-
Method Details
-
getSelectedSlot
public int getSelectedSlot() -
setSelectedSlot
public void setSelectedSlot(int p_401904_) -
getSelectedItem
-
setSelectedItem
-
getSelectionSize
public static int getSelectionSize() -
getNonEquipmentItems
-
hasRemainingSpaceForItem
-
getFreeSlot
public int getFreeSlot() -
addAndPickItem
-
pickSlot
public void pickSlot(int p_36039_) -
isHotbarSlot
public static boolean isHotbarSlot(int p_36046_) -
findSlotMatchingItem
-
isUsableForCrafting
-
findSlotMatchingCraftingIngredient
-
getSuitableHotbarSlot
public int getSuitableHotbarSlot() -
clearOrCountMatchingItems
-
addResource
-
addResource
-
getSlotWithRemainingSpace
-
tick
public void tick() -
add
-
add
-
placeItemBackInInventory
-
placeItemBackInInventory
-
createInventoryUpdatePacket
-
removeItem
- Specified by:
removeItem
in interfaceContainer
-
removeItem
-
removeItemNoUpdate
- Specified by:
removeItemNoUpdate
in interfaceContainer
-
setItem
-
save
-
load
-
getContainerSize
public int getContainerSize()- Specified by:
getContainerSize
in interfaceContainer
-
isEmpty
public boolean isEmpty() -
getItem
-
getName
-
dropAll
public void dropAll() -
setChanged
public void setChanged()- Specified by:
setChanged
in interfaceContainer
-
getTimesChanged
public int getTimesChanged() -
stillValid
- Specified by:
stillValid
in interfaceContainer
-
contains
-
contains
-
contains
-
replaceWith
-
clearContent
public void clearContent()- Specified by:
clearContent
in interfaceClearable
-
fillStackedContents
-
removeFromSelected
-