Class CraftingInventory

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

public class CraftingInventory
extends Object
implements Inventory, RecipeInputProvider
  • Field Details

  • Constructor Details

    • CraftingInventory

      public CraftingInventory​(ScreenHandler handler, int width, int height)
  • Method Details

    • size

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

      public boolean isEmpty()
      Specified by:
      isEmpty in interface 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)
      Removes the stack currently stored at the indicated slot.
      Specified by:
      removeStack in interface Inventory
      Returns:
      the stack previously stored at the indicated slot.
    • 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
    • setStack

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

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

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

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

      public int getHeight()
    • getWidth

      public int getWidth()
    • provideRecipeInputs

      public void provideRecipeInputs​(RecipeFinder finder)
      Specified by:
      provideRecipeInputs in interface RecipeInputProvider