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<?,​?>>
Enclosing interface:
Registry<T extends me.wolfyscript.utilities.util.Keyed>

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.
  • 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 interface me.wolfyscript.utilities.util.Registry<ICustomRecipe<?,​?>>
      Overrides:
      register in class me.wolfyscript.utilities.util.Registry.SimpleRegistry<ICustomRecipe<?,​?>>
    • register

      public void register(ICustomRecipe<?,​?> value)
      Specified by:
      register in interface me.wolfyscript.utilities.util.Registry<ICustomRecipe<?,​?>>
      Overrides:
      register in class me.wolfyscript.utilities.util.Registry.SimpleRegistry<ICustomRecipe<?,​?>>
    • namespaces

      public List<String> namespaces()
      Returns:
      A list of all available namespaces.
    • groups

      public List<String> groups()
      Returns:
      A list of all available groups.
    • get

      public List<ICustomRecipe<?,​?>> get(String namespace)
      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

      public List<ICustomRecipe<?,​?>> getGroup(String group)
      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

      public <T extends ICustomRecipe<?,​ ?>> List<T> get(Class<T> type)
    • get

      public <T extends ICustomRecipe<?,​ ?>> List<T> get(RecipeType<T> type)
      Type Parameters:
      T - The type passed via the RecipeType
      Parameters:
      type - The type of the recipe.
      Returns:
      A list including the ICustomRecipes of the specified RecipeType
    • getAdvancedCrafting

      public AdvancedCraftingRecipe getAdvancedCrafting(me.wolfyscript.utilities.util.NamespacedKey recipeKey)
    • getAvailable

      public List<ICustomRecipe<?,​?>> 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

      public List<ICustomRecipe<?,​?>> getAvailable(org.bukkit.entity.Player player)
      Similar to getAvailable() 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

      public <T extends ICustomRecipe<?,​ ?>> List<T> getAvailable(RecipeType<T> type)
      Same as get(RecipeType), but only includes the visible and enabled recipes.
      Type Parameters:
      T - The type passed via the RecipeType
      Parameters:
      type - The type of the recipe.
      Returns:
      A list only including the ICustomRecipes of the specified RecipeType, which are enabled and visible.
    • getAvailable

      public <T extends ICustomRecipe<?,​ ?>> List<T> getAvailable(RecipeType<T> type, org.bukkit.entity.Player player)
      Same as getAvailable(RecipeType), but additionally only includes recipes the player has permission to view.
      Type Parameters:
      T - The type passed via the RecipeType
      Parameters:
      type - The type of the recipe.
      player - The player to get the recipes for.
      Returns:
      A list only including the ICustomRecipes of the specified RecipeType, 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 as getAvailable(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()