Interface ListInventory

All Superinterfaces:
Clearable, Inventory, Iterable<ItemStack>
All Known Implementing Classes:
ChiseledBookshelfBlockEntity, ShelfBlockEntity

public interface ListInventory extends Inventory
Mappings:
Namespace Name
named net/minecraft/inventory/ListInventory
intermediary net/minecraft/class_11596
official ehp
  • Method Details

    • getHeldStacks

      DefaultedList<ItemStack> getHeldStacks()
      Mappings:
      Namespace Name Mixin selector
      named getHeldStacks Lnet/minecraft/inventory/ListInventory;getHeldStacks()Lnet/minecraft/util/collection/DefaultedList;
      intermediary method_72652 Lnet/minecraft/class_11596;method_72652()Lnet/minecraft/class_2371;
      official h Lehp;h()Ljt;
    • getFilledSlotCount

      default int getFilledSlotCount()
      Mappings:
      Namespace Name Mixin selector
      named getFilledSlotCount Lnet/minecraft/inventory/ListInventory;getFilledSlotCount()I
      intermediary method_72663 Lnet/minecraft/class_11596;method_72663()I
      official aA_ Lehp;aA_()I
    • size

      default int size()
      Returns the size of the inventory.

      The inventory should support the slot ID from 0 to size() - 1. This should remain constant throughout the inventory's lifetime.

      Specified by:
      size in interface Inventory
      Returns:
      the size of the inventory
      Mappings:
      Namespace Name Mixin selector
      named size Lnet/minecraft/inventory/Inventory;size()I
      intermediary method_5439 Lnet/minecraft/class_1263;method_5439()I
      official b Lcbj;b()I
    • clear

      default void clear()
      Specified by:
      clear in interface Clearable
      Mappings:
      Namespace Name Mixin selector
      named clear Lnet/minecraft/util/Clearable;clear()V
      intermediary method_5448 Lnet/minecraft/class_3829;method_5448()V
      official a Lcbh;a()V
    • isEmpty

      default boolean isEmpty()
      Returns whether the inventory consists entirely of empty item stacks.
      Specified by:
      isEmpty in interface Inventory
      Returns:
      whether the inventory consists entirely of empty item stacks
      Mappings:
      Namespace Name Mixin selector
      named isEmpty Lnet/minecraft/inventory/Inventory;isEmpty()Z
      intermediary method_5442 Lnet/minecraft/class_1263;method_5442()Z
      official c Lcbj;c()Z
    • getStack

      default ItemStack getStack(int slot)
      Returns the stack currently stored at slot.

      If the slot is empty, or is outside the bounds of this inventory, this returns ItemStack.EMPTY.

      Specified by:
      getStack in interface Inventory
      Returns:
      the stack currently stored at slot
      Mappings:
      Namespace Name Mixin selector
      named getStack Lnet/minecraft/inventory/Inventory;getStack(I)Lnet/minecraft/item/ItemStack;
      intermediary method_5438 Lnet/minecraft/class_1263;method_5438(I)Lnet/minecraft/class_1799;
      official a Lcbj;a(I)Ldhp;
    • removeStack

      default ItemStack removeStack(int slot, int amount)
      Removes a specific number of items from slot.
      Specified by:
      removeStack in interface Inventory
      Returns:
      the removed items as a stack
      Mappings:
      Namespace Name Mixin selector
      named removeStack Lnet/minecraft/inventory/Inventory;removeStack(II)Lnet/minecraft/item/ItemStack;
      intermediary method_5434 Lnet/minecraft/class_1263;method_5434(II)Lnet/minecraft/class_1799;
      official a Lcbj;a(II)Ldhp;
    • removeStack

      default ItemStack removeStack(int slot)
      Removes the stack currently stored at slot.
      Specified by:
      removeStack in interface Inventory
      Returns:
      the stack previously stored at the indicated slot
      Mappings:
      Namespace Name Mixin selector
      named removeStack Lnet/minecraft/inventory/Inventory;removeStack(I)Lnet/minecraft/item/ItemStack;
      intermediary method_5441 Lnet/minecraft/class_1263;method_5441(I)Lnet/minecraft/class_1799;
      official b Lcbj;b(I)Ldhp;
    • isValid

      default boolean isValid(int slot, ItemStack stack)
      Returns whether stack is valid for the slot.

      Implementations can, for example, use this to check whether the item is in a specific tag. This returns true by default.

      Specified by:
      isValid in interface Inventory
      Returns:
      whether stack is valid for the slot
      Mappings:
      Namespace Name Mixin selector
      named isValid Lnet/minecraft/inventory/Inventory;isValid(ILnet/minecraft/item/ItemStack;)Z
      intermediary method_5437 Lnet/minecraft/class_1263;method_5437(ILnet/minecraft/class_1799;)Z
      official b Lcbj;b(ILdhp;)Z
    • canAccept

      default boolean canAccept(ItemStack stack)
      Mappings:
      Namespace Name Mixin selector
      named canAccept Lnet/minecraft/inventory/ListInventory;canAccept(Lnet/minecraft/item/ItemStack;)Z
      intermediary method_72651 Lnet/minecraft/class_11596;method_72651(Lnet/minecraft/class_1799;)Z
      official b Lehp;b(Ldhp;)Z
    • setStack

      default void setStack(int slot, ItemStack stack)
      Sets the stack stored at slot to stack.
      Specified by:
      setStack in interface Inventory
      Mappings:
      Namespace Name Mixin selector
      named setStack Lnet/minecraft/inventory/Inventory;setStack(ILnet/minecraft/item/ItemStack;)V
      intermediary method_5447 Lnet/minecraft/class_1263;method_5447(ILnet/minecraft/class_1799;)V
      official a Lcbj;a(ILdhp;)V
    • setStackNoMarkDirty

      default void setStackNoMarkDirty(int slot, ItemStack stack)
      Mappings:
      Namespace Name Mixin selector
      named setStackNoMarkDirty Lnet/minecraft/inventory/ListInventory;setStackNoMarkDirty(ILnet/minecraft/item/ItemStack;)V
      intermediary method_72664 Lnet/minecraft/class_11596;method_72664(ILnet/minecraft/class_1799;)V
      official c Lehp;c(ILdhp;)V