Interface BaseRecipeHandler

All Known Subinterfaces:
RecipeLoadingEvents.ModifyRecipesCallback.RecipeHandler, RecipeLoadingEvents.RemoveRecipesCallback.RecipeHandler

@NonExtendable public interface BaseRecipeHandler
Represents common recipe handler methods.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    contains(net.minecraft.util.Identifier id)
    Returns whether the RecipeManager contains the specified recipe.
    boolean
    contains(net.minecraft.util.Identifier id, net.minecraft.recipe.RecipeType<?> type)
    Returns whether the RecipeManager contains the specified recipe of the specified recipe type.
    @Nullable net.minecraft.recipe.RecipeHolder<?>
    getRecipe(net.minecraft.util.Identifier id)
    Returns the recipe in RecipeManager from its identifier.
    <T extends net.minecraft.recipe.Recipe<?>>
    @Nullable net.minecraft.recipe.RecipeHolder<T>
    getRecipe(net.minecraft.util.Identifier id, net.minecraft.recipe.RecipeType<T> type)
    Returns the recipe of the specified recipe type in RecipeManager from its identifier.
    ImmutableMultimap<net.minecraft.recipe.RecipeType<?>,net.minecraft.recipe.RecipeHolder<?>>
    Returns all registered recipes.
    <T extends net.minecraft.recipe.Recipe<?>>
    Collection<net.minecraft.recipe.RecipeHolder<T>>
    getRecipesOfType(net.minecraft.recipe.RecipeType<T> type)
    Returns all registered recipes of the specified type.
    net.minecraft.registry.HolderLookup.Provider
     
    @Nullable net.minecraft.recipe.RecipeType<?>
    getTypeOf(net.minecraft.util.Identifier id)
    Returns the recipe type of the specified recipe.
  • Method Details

    • getTypeOf

      @Nullable @Nullable net.minecraft.recipe.RecipeType<?> getTypeOf(net.minecraft.util.Identifier id)
      Returns the recipe type of the specified recipe.
      Parameters:
      id - the identifier of the recipe
      Returns:
      the recipe type if the recipe is present, else null
    • contains

      boolean contains(net.minecraft.util.Identifier id)
      Returns whether the RecipeManager contains the specified recipe.
      Parameters:
      id - the identifier of the recipe
      Returns:
      true if the recipe is present in the RecipeManager, else false
    • contains

      boolean contains(net.minecraft.util.Identifier id, net.minecraft.recipe.RecipeType<?> type)
      Returns whether the RecipeManager contains the specified recipe of the specified recipe type.
      Parameters:
      id - the identifier of the recipe
      type - the type of the recipe
      Returns:
      true if the recipe is present in the RecipeManager, else false
    • getRecipe

      @Nullable @Nullable net.minecraft.recipe.RecipeHolder<?> getRecipe(net.minecraft.util.Identifier id)
      Returns the recipe in RecipeManager from its identifier.
      Parameters:
      id - the identifier of the recipe
      Returns:
      the recipe if present, else null
    • getRecipe

      @Nullable <T extends net.minecraft.recipe.Recipe<?>> @Nullable net.minecraft.recipe.RecipeHolder<T> getRecipe(net.minecraft.util.Identifier id, net.minecraft.recipe.RecipeType<T> type)
      Returns the recipe of the specified recipe type in RecipeManager from its identifier.
      Type Parameters:
      T - the type of the recipe
      Parameters:
      id - the identifier of the recipe
      type - the type of the recipe
      Returns:
      the recipe if present and of the correct type, else null
    • getRecipes

      ImmutableMultimap<net.minecraft.recipe.RecipeType<?>,net.minecraft.recipe.RecipeHolder<?>> getRecipes()
      Returns all registered recipes.
      Returns:
      a view of the registered recipes
    • getRecipesOfType

      <T extends net.minecraft.recipe.Recipe<?>> Collection<net.minecraft.recipe.RecipeHolder<T>> getRecipesOfType(net.minecraft.recipe.RecipeType<T> type)
      Returns all registered recipes of the specified type.
      Type Parameters:
      T - the type of the recipe
      Parameters:
      type - the recipe type
      Returns:
      a view of all the registered recipes of the specified type
    • getRegistries

      @Contract(pure=true) @NotNull net.minecraft.registry.HolderLookup.Provider getRegistries()
      Returns:
      the lookup provider; allows for safe access to the game's registries and content