Interface SynchronizedRecipes
@NonExtendable
public interface SynchronizedRecipes
This class provides access to synchronized recipes on the client.
You can access SynchronizedClientRecipes by calling getSynchronizedRecipes
method on RecipeAccess
-
Method Summary
Modifier and TypeMethodDescription@Nullable net.minecraft.world.item.crafting.RecipeHolder<?> get(net.minecraft.resources.ResourceKey<net.minecraft.world.item.crafting.Recipe<?>> key) default <T extends net.minecraft.world.item.crafting.Recipe<?>>
@Nullable net.minecraft.world.item.crafting.RecipeHolder<T> get(net.minecraft.world.item.crafting.RecipeType<T> type, net.minecraft.resources.ResourceKey<net.minecraft.world.item.crafting.Recipe<?>> key) <I extends net.minecraft.world.item.crafting.RecipeInput, T extends net.minecraft.world.item.crafting.Recipe<I>>
Stream<net.minecraft.world.item.crafting.RecipeHolder<T>> getAllMatches(net.minecraft.world.item.crafting.RecipeType<T> type, I input, net.minecraft.world.level.Level level) Creates a stream of all recipe entries of the giventypethat match the giveninputandlevel.<I extends net.minecraft.world.item.crafting.RecipeInput, T extends net.minecraft.world.item.crafting.Recipe<I>>
Collection<net.minecraft.world.item.crafting.RecipeHolder<T>> getAllOfType(net.minecraft.world.item.crafting.RecipeType<T> type) <I extends net.minecraft.world.item.crafting.RecipeInput, T extends net.minecraft.world.item.crafting.Recipe<I>>
Optional<net.minecraft.world.item.crafting.RecipeHolder<T>> getFirstMatch(net.minecraft.world.item.crafting.RecipeType<T> type, I input, net.minecraft.world.level.Level level) Finds a first recipe holder of the giventypethat matches the giveninputandlevel.default <I extends net.minecraft.world.item.crafting.RecipeInput, T extends net.minecraft.world.item.crafting.Recipe<I>>
Optional<net.minecraft.world.item.crafting.RecipeHolder<T>> getFirstMatch(net.minecraft.world.item.crafting.RecipeType<T> type, I input, net.minecraft.world.level.Level level, @Nullable net.minecraft.resources.ResourceKey<net.minecraft.world.item.crafting.Recipe<?>> recipe) Finds a first recipe holder (orrecipe, if it matches and isn't null) of the giventypethat matches the giveninputandlevel.default <I extends net.minecraft.world.item.crafting.RecipeInput, T extends net.minecraft.world.item.crafting.Recipe<I>>
Optional<net.minecraft.world.item.crafting.RecipeHolder<T>> getFirstMatch(net.minecraft.world.item.crafting.RecipeType<T> type, I input, net.minecraft.world.level.Level level, @Nullable net.minecraft.world.item.crafting.RecipeHolder<T> recipe) Finds a first recipe holder (orrecipe, if it matches and isn't null) of the giventypethat matches the giveninputandlevel.Collection<net.minecraft.world.item.crafting.RecipeHolder<?>> recipes()
-
Method Details
-
getAllMatches
<I extends net.minecraft.world.item.crafting.RecipeInput, T extends net.minecraft.world.item.crafting.Recipe<I>> Stream<net.minecraft.world.item.crafting.RecipeHolder<T>> getAllMatches(net.minecraft.world.item.crafting.RecipeType<T> type, I input, net.minecraft.world.level.Level level) Creates a stream of all recipe entries of the giventypethat match the giveninputandlevel.If
input.isEmpty()returns true, the returned stream will be always empty.- Returns:
- the stream of matching recipes
-
getAllOfType
<I extends net.minecraft.world.item.crafting.RecipeInput, T extends net.minecraft.world.item.crafting.Recipe<I>> Collection<net.minecraft.world.item.crafting.RecipeHolder<T>> getAllOfType(net.minecraft.world.item.crafting.RecipeType<T> type) - Returns:
- the collection of recipe entries of given type
-
getFirstMatch
default <I extends net.minecraft.world.item.crafting.RecipeInput, T extends net.minecraft.world.item.crafting.Recipe<I>> Optional<net.minecraft.world.item.crafting.RecipeHolder<T>> getFirstMatch(net.minecraft.world.item.crafting.RecipeType<T> type, I input, net.minecraft.world.level.Level level, @Nullable net.minecraft.resources.ResourceKey<net.minecraft.world.item.crafting.Recipe<?>> recipe) Finds a first recipe holder (orrecipe, if it matches and isn't null) of the giventypethat matches the giveninputandlevel.- Returns:
- the optional containing matching recipe holder or empty
-
getFirstMatch
default <I extends net.minecraft.world.item.crafting.RecipeInput, T extends net.minecraft.world.item.crafting.Recipe<I>> Optional<net.minecraft.world.item.crafting.RecipeHolder<T>> getFirstMatch(net.minecraft.world.item.crafting.RecipeType<T> type, I input, net.minecraft.world.level.Level level, @Nullable net.minecraft.world.item.crafting.RecipeHolder<T> recipe) Finds a first recipe holder (orrecipe, if it matches and isn't null) of the giventypethat matches the giveninputandlevel.- Returns:
- the optional containing matching recipe holder or empty
-
getFirstMatch
<I extends net.minecraft.world.item.crafting.RecipeInput, T extends net.minecraft.world.item.crafting.Recipe<I>> Optional<net.minecraft.world.item.crafting.RecipeHolder<T>> getFirstMatch(net.minecraft.world.item.crafting.RecipeType<T> type, I input, net.minecraft.world.level.Level level) Finds a first recipe holder of the giventypethat matches the giveninputandlevel.- Returns:
- the optional containing matching recipe holder or empty
-
get
@Nullable net.minecraft.world.item.crafting.RecipeHolder<?> get(net.minecraft.resources.ResourceKey<net.minecraft.world.item.crafting.Recipe<?>> key) - Returns:
- recipe with matching
keyor null if not present
-
get
default <T extends net.minecraft.world.item.crafting.Recipe<?>> @Nullable net.minecraft.world.item.crafting.RecipeHolder<T> get(net.minecraft.world.item.crafting.RecipeType<T> type, net.minecraft.resources.ResourceKey<net.minecraft.world.item.crafting.Recipe<?>> key) - Returns:
- recipe with matching
keyof typetypeor null if not present
-
recipes
Collection<net.minecraft.world.item.crafting.RecipeHolder<?>> recipes()- Returns:
- collection of all synchronized recipe types
-