Package me.wolfyscript.customcrafting
Class Registry.RecipeRegistry
java.lang.Object
me.wolfyscript.utilities.util.Registry.SimpleRegistry<ICustomRecipe<?,?>>
me.wolfyscript.customcrafting.Registry.RecipeRegistry
- All Implemented Interfaces:
Iterable<ICustomRecipe<?,?>>
,me.wolfyscript.utilities.util.Registry<ICustomRecipe<?,?>>
public static class Registry.RecipeRegistry
extends me.wolfyscript.utilities.util.Registry.SimpleRegistry<ICustomRecipe<?,?>>
The custom Registry for the Recipes of CustomCrafting.
Providing a lot of functionality to get the recipes you need.
-
Nested Class Summary
Nested classes/interfaces inherited from interface me.wolfyscript.utilities.util.Registry
me.wolfyscript.utilities.util.Registry.CustomItemRegistry, me.wolfyscript.utilities.util.Registry.MetaRegistry, me.wolfyscript.utilities.util.Registry.ParticleAnimationRegistry, me.wolfyscript.utilities.util.Registry.ParticleRegistry, me.wolfyscript.utilities.util.Registry.SimpleRegistry<V extends me.wolfyscript.utilities.util.Keyed>
-
Field Summary
Fields inherited from class me.wolfyscript.utilities.util.Registry.SimpleRegistry
map
Fields inherited from interface me.wolfyscript.utilities.util.Registry
CUSTOM_ITEM_DATA, CUSTOM_ITEMS, ITEM_TAGS, META_PROVIDER, PARTICLE_ANIMATIONS, PARTICLE_EFFECTS
-
Method Summary
Modifier and TypeMethodDescription<T extends ICustomRecipe<?, ?>>
List<T>List<ICustomRecipe<?,?>>
Returns a List of all recipes contained in the namespace.<T extends ICustomRecipe<?, ?>>
List<T>get(RecipeType<T> type)
List<ICustomRecipe<?,?>>
get(me.wolfyscript.utilities.api.inventory.custom_items.CustomItem result)
getAdvancedCrafting(me.wolfyscript.utilities.util.NamespacedKey recipeKey)
List<ICustomRecipe<?,?>>
Get all the recipes that are available.<T extends ICustomRecipe<?, ?>>
List<T>getAvailable(List<T> recipes, @Nullable org.bukkit.entity.Player player)
<T extends ICustomRecipe<?, ?>>
List<T>getAvailable(RecipeType<T> type)
Same asget(RecipeType)
, but only includes the visible and enabled recipes.<T extends ICustomRecipe<?, ?>>
List<T>getAvailable(RecipeType<T> type, org.bukkit.entity.Player player)
Same asgetAvailable(RecipeType)
, but additionally only includes recipes the player has permission to view.List<ICustomRecipe<?,?>>
getAvailable(org.bukkit.entity.Player player)
Similar togetAvailable()
only includes the visible and enabled recipes, but also takes the player into account.List<ICustomRecipe<?,?>>
getAvailable(org.bukkit.inventory.ItemStack result, org.bukkit.entity.Player player)
The same asgetAvailable(Player)
, but only includes the recipes that contain the similar ItemStack in the result List.List<ICustomRecipe<?,?>>
Get all the Recipes from this groupStream<CraftingRecipe<?>>
getSimilar(List<List<org.bukkit.inventory.ItemStack>> items, boolean elite, boolean advanced)
groups()
boolean
has(me.wolfyscript.utilities.util.NamespacedKey namespacedKey)
void
register(ICustomRecipe<?,?> value)
void
register(me.wolfyscript.utilities.util.NamespacedKey namespacedKey, ICustomRecipe<?,?> value)
void
remove(me.wolfyscript.utilities.util.NamespacedKey namespacedKey)
int
size()
Methods inherited from class me.wolfyscript.utilities.util.Registry.SimpleRegistry
entrySet, get, iterator, keySet, values
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
has
public boolean has(me.wolfyscript.utilities.util.NamespacedKey namespacedKey) -
remove
public void remove(me.wolfyscript.utilities.util.NamespacedKey namespacedKey) -
register
public void register(me.wolfyscript.utilities.util.NamespacedKey namespacedKey, ICustomRecipe<?,?> value)- Specified by:
register
in interfaceme.wolfyscript.utilities.util.Registry<ICustomRecipe<?,?>>
- Overrides:
register
in classme.wolfyscript.utilities.util.Registry.SimpleRegistry<ICustomRecipe<?,?>>
-
register
- Specified by:
register
in interfaceme.wolfyscript.utilities.util.Registry<ICustomRecipe<?,?>>
- Overrides:
register
in classme.wolfyscript.utilities.util.Registry.SimpleRegistry<ICustomRecipe<?,?>>
-
namespaces
- Returns:
- A list of all available namespaces.
-
groups
- Returns:
- A list of all available groups.
-
get
Returns a List of all recipes contained in the namespace.- Parameters:
namespace
- The namespace to get recipes from.- Returns:
- The recipes contained in the namespace.
-
getGroup
Get all the Recipes from this group- Parameters:
group
- The group to get recipes from.- Returns:
- The recipes contained in the group.
-
get
public List<ICustomRecipe<?,?>> get(me.wolfyscript.utilities.api.inventory.custom_items.CustomItem result) -
get
-
get
- Type Parameters:
T
- The type passed via theRecipeType
- Parameters:
type
- The type of the recipe.- Returns:
- A list including the
ICustomRecipe
s of the specifiedRecipeType
-
getAdvancedCrafting
public AdvancedCraftingRecipe getAdvancedCrafting(me.wolfyscript.utilities.util.NamespacedKey recipeKey) -
getAvailable
Get all the recipes that are available. Recipes that are hidden or disabled are not included.- Returns:
- The recipes that are available and are not hidden or disabled.
-
getAvailable
Similar togetAvailable()
only includes the visible and enabled recipes, but also takes the player into account. Recipes that the player has no permission to view are not included.- Parameters:
player
- The player to get the recipes for.- Returns:
- The recipes that are available and the player has permission to view.
-
getAvailable
Same asget(RecipeType)
, but only includes the visible and enabled recipes.- Type Parameters:
T
- The type passed via theRecipeType
- Parameters:
type
- The type of the recipe.- Returns:
- A list only including the
ICustomRecipe
s of the specifiedRecipeType
, which are enabled and visible.
-
getAvailable
public <T extends ICustomRecipe<?, ?>> List<T> getAvailable(RecipeType<T> type, org.bukkit.entity.Player player)Same asgetAvailable(RecipeType)
, but additionally only includes recipes the player has permission to view.- Type Parameters:
T
- The type passed via theRecipeType
- Parameters:
type
- The type of the recipe.player
- The player to get the recipes for.- Returns:
- A list only including the
ICustomRecipe
s of the specifiedRecipeType
, which are enabled, visible and the Player has permission to view.
-
getAvailable
public List<ICustomRecipe<?,?>> getAvailable(org.bukkit.inventory.ItemStack result, org.bukkit.entity.Player player)The same asgetAvailable(Player)
, but only includes the recipes that contain the similar ItemStack in the result List.- Parameters:
result
- The result ItemsStack to look for.player
- The player to get the recipes for.- Returns:
- All the recipes, that have the specified Result, are not hidden, and the player has permission to view.
-
getAvailable
public <T extends ICustomRecipe<?, ?>> List<T> getAvailable(List<T> recipes, @Nullable @Nullable org.bukkit.entity.Player player) -
getSimilar
public Stream<CraftingRecipe<?>> getSimilar(List<List<org.bukkit.inventory.ItemStack>> items, boolean elite, boolean advanced) -
size
public int size()
-