Package net.minecraft.inventory
Interface ListInventory
- All Known Implementing Classes:
ChiseledBookshelfBlockEntity,ShelfBlockEntity
- Mappings:
Namespace Name named net/minecraft/inventory/ListInventoryintermediary net/minecraft/class_11596official ehp
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.inventory.Inventory
Inventory.Iterator -
Field Summary
Fields inherited from interface net.minecraft.inventory.Inventory
DEFAULT_MAX_INTERACTION_RANGE -
Method Summary
Modifier and TypeMethodDescriptiondefault booleandefault voidclear()default intdefault ItemStackgetStack(int slot) Returns the stack currently stored atslot.default booleanisEmpty()Returns whether the inventory consists entirely of empty item stacks.default booleanReturns whetherstackis valid for theslot.default ItemStackremoveStack(int slot) Removes the stack currently stored atslot.default ItemStackremoveStack(int slot, int amount) Removes a specific number of items fromslot.default voidSets the stack stored atslottostack.default voidsetStackNoMarkDirty(int slot, ItemStack stack) default intsize()Returns the size of the inventory.Methods inherited from interface net.minecraft.inventory.Inventory
canPlayerUse, canTransferTo, containsAny, containsAny, count, getMaxCount, getMaxCountPerStack, getViewingUsers, iterator, markDirty, onClose, onOpenMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
getHeldStacks
DefaultedList<ItemStack> getHeldStacks()- Mappings:
Namespace Name Mixin selector named getHeldStacksLnet/minecraft/inventory/ListInventory;getHeldStacks()Lnet/minecraft/util/collection/DefaultedList;intermediary method_72652Lnet/minecraft/class_11596;method_72652()Lnet/minecraft/class_2371;official hLehp;h()Ljt;
-
getFilledSlotCount
default int getFilledSlotCount()- Mappings:
Namespace Name Mixin selector named getFilledSlotCountLnet/minecraft/inventory/ListInventory;getFilledSlotCount()Iintermediary method_72663Lnet/minecraft/class_11596;method_72663()Iofficial aA_Lehp;aA_()I
-
size
default int size()Returns the size of the inventory.The inventory should support the slot ID from
0tosize() - 1. This should remain constant throughout the inventory's lifetime. -
clear
default void clear() -
isEmpty
default boolean isEmpty()Returns whether the inventory consists entirely of empty item stacks.- Specified by:
isEmptyin interfaceInventory- Returns:
- whether the inventory consists entirely of empty item stacks
- Mappings:
Namespace Name Mixin selector named isEmptyLnet/minecraft/inventory/Inventory;isEmpty()Zintermediary method_5442Lnet/minecraft/class_1263;method_5442()Zofficial cLcbj;c()Z
-
getStack
Returns the stack currently stored atslot.If the slot is empty, or is outside the bounds of this inventory, this returns
ItemStack.EMPTY.- Specified by:
getStackin interfaceInventory- Returns:
- the stack currently stored at
slot - Mappings:
Namespace Name Mixin selector named getStackLnet/minecraft/inventory/Inventory;getStack(I)Lnet/minecraft/item/ItemStack;intermediary method_5438Lnet/minecraft/class_1263;method_5438(I)Lnet/minecraft/class_1799;official aLcbj;a(I)Ldhp;
-
removeStack
Removes a specific number of items fromslot.- Specified by:
removeStackin interfaceInventory- Returns:
- the removed items as a stack
- Mappings:
Namespace Name Mixin selector named removeStackLnet/minecraft/inventory/Inventory;removeStack(II)Lnet/minecraft/item/ItemStack;intermediary method_5434Lnet/minecraft/class_1263;method_5434(II)Lnet/minecraft/class_1799;official aLcbj;a(II)Ldhp;
-
removeStack
Removes the stack currently stored atslot.- Specified by:
removeStackin interfaceInventory- Returns:
- the stack previously stored at the indicated slot
- Mappings:
Namespace Name Mixin selector named removeStackLnet/minecraft/inventory/Inventory;removeStack(I)Lnet/minecraft/item/ItemStack;intermediary method_5441Lnet/minecraft/class_1263;method_5441(I)Lnet/minecraft/class_1799;official bLcbj;b(I)Ldhp;
-
isValid
Returns whetherstackis valid for theslot.Implementations can, for example, use this to check whether the item is in a specific tag. This returns
trueby default.- Specified by:
isValidin interfaceInventory- Returns:
- whether
stackis valid for theslot - Mappings:
Namespace Name Mixin selector named isValidLnet/minecraft/inventory/Inventory;isValid(ILnet/minecraft/item/ItemStack;)Zintermediary method_5437Lnet/minecraft/class_1263;method_5437(ILnet/minecraft/class_1799;)Zofficial bLcbj;b(ILdhp;)Z
-
canAccept
- Mappings:
Namespace Name Mixin selector named canAcceptLnet/minecraft/inventory/ListInventory;canAccept(Lnet/minecraft/item/ItemStack;)Zintermediary method_72651Lnet/minecraft/class_11596;method_72651(Lnet/minecraft/class_1799;)Zofficial bLehp;b(Ldhp;)Z
-
setStack
Sets the stack stored atslottostack. -
setStackNoMarkDirty
- Mappings:
Namespace Name Mixin selector named setStackNoMarkDirtyLnet/minecraft/inventory/ListInventory;setStackNoMarkDirty(ILnet/minecraft/item/ItemStack;)Vintermediary method_72664Lnet/minecraft/class_11596;method_72664(ILnet/minecraft/class_1799;)Vofficial cLehp;c(ILdhp;)V
-