Class ResultContainer

java.lang.Object
net.minecraft.world.inventory.ResultContainer
All Implemented Interfaces:
Clearable, Container, RecipeCraftingHolder

public class ResultContainer extends Object implements Container, RecipeCraftingHolder
  • Field Details

  • Constructor Details

    • ResultContainer

      public ResultContainer()
  • Method Details

    • getContainerSize

      public int getContainerSize()
      Specified by:
      getContainerSize in interface Container
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface Container
    • getItem

      public ItemStack getItem(int pIndex)
      Returns the stack in the given slot.
      Specified by:
      getItem in interface Container
    • removeItem

      public ItemStack removeItem(int pIndex, int pCount)
      Removes up to a specified number of items from an inventory slot and returns them in a new stack.
      Specified by:
      removeItem in interface Container
    • removeItemNoUpdate

      public ItemStack removeItemNoUpdate(int pIndex)
      Removes a stack from the given slot and returns it.
      Specified by:
      removeItemNoUpdate in interface Container
    • setItem

      public void setItem(int pIndex, ItemStack pStack)
      Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections).
      Specified by:
      setItem in interface Container
    • setChanged

      public void setChanged()
      Specified by:
      setChanged in interface Container
    • stillValid

      public boolean stillValid(Player pPlayer)
      Don't rename this method to canInteractWith due to conflicts with Container
      Specified by:
      stillValid in interface Container
    • clearContent

      public void clearContent()
      Specified by:
      clearContent in interface Clearable
    • setRecipeUsed

      public void setRecipeUsed(@Nullable RecipeHolder<?> pRecipe)
      Specified by:
      setRecipeUsed in interface RecipeCraftingHolder
    • getRecipeUsed

      @Nullable public RecipeHolder<?> getRecipeUsed()
      Specified by:
      getRecipeUsed in interface RecipeCraftingHolder