Class PlanetRecipes
java.lang.Object
ua.mcchickenstudio.opencreative.planets.PlanetRecipes
PlanetRecipes
This class represents planet's recipes registry, that has methods to register and unregister recipe.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddRecipe(@NotNull org.bukkit.NamespacedKey key, @NotNull org.bukkit.inventory.Recipe recipe) Registers recipe, or replaces old one with specified new.voidclear()Removes all recipes and destroys them.voidclearForPlayer(@NotNull org.bukkit.entity.Player player) Removes all recipes from player.intReturns amount of all recipes.@NotNull StringgetFullKey(@NotNull String name) Returns full namespaced key for recipe with specified name.@Nullable org.bukkit.NamespacedKeyReturns recipe's namespaced key.voidremoveRecipe(@NotNull String name) Unregisters recipe from registry and removes it from players.voidremoveRecipe(@NotNull org.bukkit.NamespacedKey recipe) Unregisters recipe from registry and takes it from players.
-
Constructor Details
-
PlanetRecipes
-
-
Method Details
-
addRecipe
public void addRecipe(@NotNull @NotNull org.bukkit.NamespacedKey key, @NotNull @NotNull org.bukkit.inventory.Recipe recipe) Registers recipe, or replaces old one with specified new.- Parameters:
key- key of recipe (must start with "oc_recipe_WORLDID").recipe- recipe to register.
-
removeRecipe
Unregisters recipe from registry and removes it from players.- Parameters:
name- name of recipe.
-
removeRecipe
public void removeRecipe(@NotNull @NotNull org.bukkit.NamespacedKey recipe) Unregisters recipe from registry and takes it from players.- Parameters:
recipe- namespaced key of recipe.
-
getRecipe
Returns recipe's namespaced key.- Parameters:
name- name of recipe.- Returns:
- recipe's namespaced key, or null - if not found.
-
clear
public void clear()Removes all recipes and destroys them. -
clearForPlayer
public void clearForPlayer(@NotNull @NotNull org.bukkit.entity.Player player) Removes all recipes from player.- Parameters:
player- player to remove recipes.
-
getAmount
public int getAmount()Returns amount of all recipes.- Returns:
- amount of recipes.
-
getFullKey
-