Class RecipeManager
java.lang.Object
org.mockbukkit.mockbukkit.inventory.RecipeManager
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddRecipe(@NotNull RecipeType recipeType, @NotNull Recipe recipe) Add a recipe to the list of recipes.voidclearRecipes(RecipeType recipeType) Clears the list of recipes.@Nullable RecipegetCraftingRecipe(@NotNull ItemStack[] craftingMatrix) @Nullable RecipegetRecipeByKey(@NotNull RecipeType recipeType, @NotNull NamespacedKey recipeKey) Helper function to lazy load the recipes.@NotNull Map<RecipeType, List<Recipe>> Get the list of recipes available.getRecipes(@NotNull RecipeType recipeType) Get the list of recipes available for that recipe type.getRecipesFor(@NotNull RecipeType recipeType, @NotNull ItemStack itemStack) Get the list of recipes available to create a desired item.static Map<RecipeType, List<Recipe>> loadDefaultRecipes(RecipeType recipeType) booleanremoveRecipe(@NotNull RecipeType recipeType, @NotNull Recipe recipe) Remove a recipe to the list of recipes.voidreset()Resets the list of recipes to the default.voidreset(@NotNull RecipeType recipeType) Resets the list of recipes to the default for a given recipe type.
-
Constructor Details
-
RecipeManager
public RecipeManager()
-
-
Method Details
-
reset
public void reset()Resets the list of recipes to the default. -
reset
Resets the list of recipes to the default for a given recipe type.- Parameters:
recipeType- The recipe type to reset.
-
getRecipes
Get the list of recipes available.- Returns:
- The list of recipes available.
-
getRecipes
Get the list of recipes available for that recipe type.- Parameters:
recipeType- The recipe type.- Returns:
- The list of recipes available.
-
getRecipeByKey
@Nullable public @Nullable Recipe getRecipeByKey(@NotNull @NotNull RecipeType recipeType, @NotNull @NotNull NamespacedKey recipeKey) Helper function to lazy load the recipes.- Parameters:
recipeType- The recipe type to get the recipes.recipeKey- The recipe key to get the recipes.- Returns:
- The server recipes.
-
getRecipesFor
@NotNull public @NotNull List<Recipe> getRecipesFor(@NotNull @NotNull RecipeType recipeType, @NotNull @NotNull ItemStack itemStack) Get the list of recipes available to create a desired item.- Parameters:
recipeType- The recipe type.itemStack- The desired item.- Returns:
- The list of recipes available to create.
-
getCraftingRecipe
-
addRecipe
Add a recipe to the list of recipes.- Parameters:
recipeType- The recipe type.recipe- The recipe to be added.- Returns:
trueif added, otherwisefalse.
-
removeRecipe
public boolean removeRecipe(@NotNull @NotNull RecipeType recipeType, @NotNull @NotNull Recipe recipe) Remove a recipe to the list of recipes.- Parameters:
recipeType- The recipe type.recipe- The recipe to be removed.- Returns:
trueif removed, otherwisefalse.
-
clearRecipes
Clears the list of recipes. -
loadDefaultRecipes
-
loadDefaultRecipes
-
loadDefaultRecipesAsLists
-