Class Ingredient

java.lang.Object
valorless.valorlessutils.crafting.Ingredient

public class Ingredient extends Object
Represents an ingredient used in crafting recipes.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    int
    Amount needed when using Shapeless recipes
    org.bukkit.inventory.ItemStack
    The ItemStack representing the ingredient.
    char
    The identification letter of the ingredient.
    org.bukkit.Material
    The Material of the ingredient.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Ingredient(String letter, org.bukkit.inventory.ItemStack item)
    Constructs an Ingredient object with an identification letter and an ItemStack.
    The ingredient's material will also be set to the material of 'item'.
    Ingredient(String letter, org.bukkit.Material material)
    Constructs an Ingredient object with an identification letter and a Material.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    SetAmount(int amount)
    Set the amount of the Ingredient required, for Shapeless recipes.
    Returns a string representation of the Ingredient object.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • letter

      public char letter
      The identification letter of the ingredient.
    • item

      public org.bukkit.inventory.ItemStack item
      The ItemStack representing the ingredient.
    • material

      public org.bukkit.Material material
      The Material of the ingredient.
    • amount

      public int amount
      Amount needed when using Shapeless recipes
  • Constructor Details

    • Ingredient

      public Ingredient(String letter, org.bukkit.inventory.ItemStack item)
      Constructs an Ingredient object with an identification letter and an ItemStack.
      The ingredient's material will also be set to the material of 'item'.
      Parameters:
      letter - The identification letter.
      item - The ItemStack representing the ingredient.
    • Ingredient

      public Ingredient(String letter, org.bukkit.Material material)
      Constructs an Ingredient object with an identification letter and a Material.
      Parameters:
      letter - The identification letter.
      material - The Material of the ingredient.
  • Method Details

    • SetAmount

      public void SetAmount(int amount)
      Set the amount of the Ingredient required, for Shapeless recipes.
      Parameters:
      amount - The amount of the ingredient. (1 - 64)
    • toString

      public String toString()
      Returns a string representation of the Ingredient object.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the Ingredient object.