Class CraftingRecipeData

java.lang.Object
me.mehboss.utils.RecipeUtil.Recipe
me.mehboss.utils.data.CraftingRecipeData

public class CraftingRecipeData extends RecipeUtil.Recipe
Stores additional data for custom crafting recipes.

Extends RecipeUtil.Recipe with fields used only by crafting systems, including leftover item rules, conditional requirements, and optional recipe grouping. This class acts only as a data container and does not enforce how a recipe is created.

  • Constructor Details

    • CraftingRecipeData

      public CraftingRecipeData(String name)
  • Method Details

    • addLeftoverItem

      public void addLeftoverItem(String id)
      Setter for adding an ingredient as a leftover
      Parameters:
      id - the id of the ingredient to be leftover.
    • isLeftover

      public Boolean isLeftover(String id)
      Checks if a MATERIAL is marked as leftover.
    • getGroup

      public String getGroup()
      Getter for the recipe group.

      Available since Spigot 1.13+

      Returns:
      the group string this recipe belongs to. Empty string means no group.
    • setGroup

      public void setGroup(String group)
      Sets the group of the recipe. Recipes with the same group may be grouped together when displayed in the client.

      Available since Spigot 1.13+

      Parameters:
      group - the group name. Empty string denotes no group.
    • getConditionSet

      public RecipeConditions.ConditionSet getConditionSet()
      Gets the ConditionSet attached to this recipe. Conditions define extra requirements for crafting (e.g. world, time, weather).
      Returns:
      the ConditionSet for this recipe, never null
    • setConditionSet

      public void setConditionSet(RecipeConditions.ConditionSet cs)
      Sets the ConditionSet for this recipe. If cs is null, an empty ConditionSet is applied instead.
      Parameters:
      cs - the new ConditionSet for this recipe, can be null