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

See RecipeSynchronization.

  • Method Summary

    Modifier and Type
    Method
    Description
    @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 given type that match the given input and level.
    <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 given type that matches the given input and level.
    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 (or recipe, if it matches and isn't null) of the given type that matches the given input and level.
    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 (or recipe, if it matches and isn't null) of the given type that matches the given input and level.
    Collection<net.minecraft.world.item.crafting.RecipeHolder<?>>
     
  • 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 given type that match the given input and level.

      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 (or recipe, if it matches and isn't null) of the given type that matches the given input and level.
      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 (or recipe, if it matches and isn't null) of the given type that matches the given input and level.
      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 given type that matches the given input and level.
      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 key or 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 key of type type or null if not present
    • recipes

      Collection<net.minecraft.world.item.crafting.RecipeHolder<?>> recipes()
      Returns:
      collection of all synchronized recipe types