Class DoubleInventory

java.lang.Object
net.minecraft.inventory.DoubleInventory
All Implemented Interfaces:
Inventory, Clearable

public class DoubleInventory
extends Object
implements Inventory
  • Field Details

  • Constructor Details

  • Method Details

    • size

      public int size()
      Specified by:
      size in interface Inventory
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface Inventory
    • isPart

      public boolean isPart​(Inventory inventory)
    • getStack

      public ItemStack getStack​(int slot)
      Fetches the stack currently stored at the given slot. If the slot is empty, or is outside the bounds of this inventory, returns see ItemStack.EMPTY.
      Specified by:
      getStack in interface Inventory
    • removeStack

      public ItemStack removeStack​(int slot, int amount)
      Removes a specific number of items from the given slot.
      Specified by:
      removeStack in interface Inventory
      Returns:
      the removed items as a stack
    • removeStack

      public ItemStack removeStack​(int slot)
      Removes the stack currently stored at the indicated slot.
      Specified by:
      removeStack in interface Inventory
      Returns:
      the stack previously stored at the indicated slot.
    • setStack

      public void setStack​(int slot, ItemStack stack)
      Specified by:
      setStack in interface Inventory
    • getMaxCountPerStack

      public int getMaxCountPerStack()
      Returns the maximum number of items a stack can contain when placed inside this inventory. No slots may have more than this number of items. It is effectively the stacking limit for this inventory's slots.
      Specified by:
      getMaxCountPerStack in interface Inventory
      Returns:
      the max count of item stacks in this inventory
    • markDirty

      public void markDirty()
      Specified by:
      markDirty in interface Inventory
    • canPlayerUse

      public boolean canPlayerUse​(PlayerEntity player)
      Specified by:
      canPlayerUse in interface Inventory
    • onOpen

      public void onOpen​(PlayerEntity player)
      Specified by:
      onOpen in interface Inventory
    • onClose

      public void onClose​(PlayerEntity player)
      Specified by:
      onClose in interface Inventory
    • isValid

      public boolean isValid​(int slot, ItemStack stack)
      Returns whether the given stack is a valid for the indicated slot position.
      Specified by:
      isValid in interface Inventory
    • clear

      public void clear()
      Specified by:
      clear in interface Clearable