Package org.quiltmc.qsl.recipe.api
Interface BaseRecipeHandler
- All Known Subinterfaces:
RecipeLoadingEvents.ModifyRecipesCallback.RecipeHandler,RecipeLoadingEvents.RemoveRecipesCallback.RecipeHandler
@NonExtendable
public interface BaseRecipeHandler
Represents common recipe handler methods.
-
Method Summary
Modifier and TypeMethodDescriptionbooleancontains(net.minecraft.util.Identifier id) Returns whether theRecipeManagercontains the specified recipe.booleancontains(net.minecraft.util.Identifier id, net.minecraft.recipe.RecipeType<?> type) Returns whether theRecipeManagercontains the specified recipe of the specified recipe type.@Nullable net.minecraft.recipe.RecipeHolder<?> getRecipe(net.minecraft.util.Identifier id) Returns the recipe inRecipeManagerfrom 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 inRecipeManagerfrom 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 theRecipeManagercontains the specified recipe.- Parameters:
id- the identifier of the recipe- Returns:
trueif the recipe is present in theRecipeManager, elsefalse
-
contains
boolean contains(net.minecraft.util.Identifier id, net.minecraft.recipe.RecipeType<?> type) Returns whether theRecipeManagercontains the specified recipe of the specified recipe type.- Parameters:
id- the identifier of the recipetype- the type of the recipe- Returns:
trueif the recipe is present in theRecipeManager, elsefalse
-
getRecipe
@Nullable @Nullable net.minecraft.recipe.RecipeHolder<?> getRecipe(net.minecraft.util.Identifier id) Returns the recipe inRecipeManagerfrom 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 inRecipeManagerfrom its identifier.- Type Parameters:
T- the type of the recipe- Parameters:
id- the identifier of the recipetype- 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
-