Class RecipeManager

All Implemented Interfaces:
class_10286, ResourceReloader

public class RecipeManager extends SinglePreparationResourceReloader<class_10289> implements class_10286
A recipe manager allows easier use of recipes, such as finding matches and remainders. It is also integrated with a recipe loader, which loads recipes from data packs' JSON files.
Mappings:
Namespace Name
named net/minecraft/recipe/RecipeManager
intermediary net/minecraft/class_1863
official dcf
  • Field Details

    • LOGGER

      private static final Logger LOGGER
      Mappings:
      Namespace Name Mixin selector
      named LOGGER Lnet/minecraft/recipe/RecipeManager;LOGGER:Lorg/slf4j/Logger;
      intermediary field_9027 Lnet/minecraft/class_1863;field_9027:Lorg/slf4j/Logger;
      official a Ldcf;a:Lorg/slf4j/Logger;
    • field_54637

      private final RegistryWrapper.WrapperLookup field_54637
      Mappings:
      Namespace Name Mixin selector
      named field_54637 Lnet/minecraft/recipe/RecipeManager;field_54637:Lnet/minecraft/registry/RegistryWrapper$WrapperLookup;
      intermediary field_54637 Lnet/minecraft/class_1863;field_54637:Lnet/minecraft/class_7225$class_7874;
      official b Ldcf;b:Ljs$a;
    • field_54638

      private class_10289 field_54638
      Mappings:
      Namespace Name Mixin selector
      named field_54638 Lnet/minecraft/recipe/RecipeManager;field_54638:Lnet/minecraft/class_10289;
      intermediary field_54638 Lnet/minecraft/class_1863;field_54638:Lnet/minecraft/class_10289;
      official c Ldcf;c:Ldcg;
    • field_54639

      private Map<RegistryKey<class_10290>,class_10290> field_54639
      Mappings:
      Namespace Name Mixin selector
      named field_54639 Lnet/minecraft/recipe/RecipeManager;field_54639:Ljava/util/Map;
      intermediary field_54639 Lnet/minecraft/class_1863;field_54639:Ljava/util/Map;
      official d Ldcf;d:Ljava/util/Map;
    • field_54640

      Mappings:
      Namespace Name Mixin selector
      named field_54640 Lnet/minecraft/recipe/RecipeManager;field_54640:Lnet/minecraft/class_10291$class_10293;
      intermediary field_54640 Lnet/minecraft/class_1863;field_54640:Lnet/minecraft/class_10291$class_10293;
      official e Ldcf;e:Ldcl$b;
    • field_54641

      private List<RecipeManager.class_10288> field_54641
      Mappings:
      Namespace Name Mixin selector
      named field_54641 Lnet/minecraft/recipe/RecipeManager;field_54641:Ljava/util/List;
      intermediary field_54641 Lnet/minecraft/class_1863;field_54641:Ljava/util/List;
      official f Ldcf;f:Ljava/util/List;
    • field_54642

      Mappings:
      Namespace Name Mixin selector
      named field_54642 Lnet/minecraft/recipe/RecipeManager;field_54642:Ljava/util/Map;
      intermediary field_54642 Lnet/minecraft/class_1863;field_54642:Ljava/util/Map;
      official g Ldcf;g:Ljava/util/Map;
  • Constructor Details

  • Method Details

    • prepare

      protected class_10289 prepare(ResourceManager resourceManager, Profiler profiler)
      Description copied from class: SinglePreparationResourceReloader
      Prepares the intermediate object.

      This method is called in the prepare executor in a reload.

      Specified by:
      prepare in class SinglePreparationResourceReloader<class_10289>
      Parameters:
      resourceManager - the resource manager
      profiler - the prepare profiler
      Returns:
      the prepared object
      Mappings:
      Namespace Name Mixin selector
      named prepare Lnet/minecraft/recipe/RecipeManager;prepare(Lnet/minecraft/resource/ResourceManager;Lnet/minecraft/util/profiler/Profiler;)Lnet/minecraft/class_10289;
      intermediary method_64680 Lnet/minecraft/class_1863;method_64680(Lnet/minecraft/class_3300;Lnet/minecraft/class_3695;)Lnet/minecraft/class_10289;
      official a Ldcf;a(Lavv;Lbpo;)Ldcg;
    • apply

      protected void apply(class_10289 class_10289, ResourceManager resourceManager, Profiler profiler)
      Description copied from class: SinglePreparationResourceReloader
      Handles the prepared intermediate object.

      This method is called in the apply executor, or the game engine, in a reload.

      Specified by:
      apply in class SinglePreparationResourceReloader<class_10289>
      Parameters:
      class_10289 - the prepared object
      resourceManager - the resource manager
      profiler - the apply profiler
      Mappings:
      Namespace Name Mixin selector
      named apply Lnet/minecraft/recipe/RecipeManager;apply(Lnet/minecraft/class_10289;Lnet/minecraft/resource/ResourceManager;Lnet/minecraft/util/profiler/Profiler;)V
      intermediary method_20705 Lnet/minecraft/class_1863;method_20705(Lnet/minecraft/class_10289;Lnet/minecraft/class_3300;Lnet/minecraft/class_3695;)V
      official a Ldcf;a(Ldcg;Lavv;Lbpo;)V
    • method_64681

      public void method_64681(FeatureSet featureSet)
      Mappings:
      Namespace Name Mixin selector
      named method_64681 Lnet/minecraft/recipe/RecipeManager;method_64681(Lnet/minecraft/resource/featuretoggle/FeatureSet;)V
      intermediary method_64681 Lnet/minecraft/class_1863;method_64681(Lnet/minecraft/class_7699;)V
      official a Ldcf;a(Lcso;)V
    • method_64683

      private static List<Ingredient> method_64683(FeatureSet featureSet, List<Ingredient> list)
      Mappings:
      Namespace Name Mixin selector
      named method_64683 Lnet/minecraft/recipe/RecipeManager;method_64683(Lnet/minecraft/resource/featuretoggle/FeatureSet;Ljava/util/List;)Ljava/util/List;
      intermediary method_64683 Lnet/minecraft/class_1863;method_64683(Lnet/minecraft/class_7699;Ljava/util/List;)Ljava/util/List;
      official a Ldcf;a(Lcso;Ljava/util/List;)Ljava/util/List;
    • method_64682

      private static boolean method_64682(FeatureSet featureSet, Ingredient ingredient)
      Mappings:
      Namespace Name Mixin selector
      named method_64682 Lnet/minecraft/recipe/RecipeManager;method_64682(Lnet/minecraft/resource/featuretoggle/FeatureSet;Lnet/minecraft/recipe/Ingredient;)Z
      intermediary method_64682 Lnet/minecraft/class_1863;method_64682(Lnet/minecraft/class_7699;Lnet/minecraft/class_1856;)Z
      official a Ldcf;a(Lcso;Ldbv;)Z
    • getFirstMatch

      public <I extends RecipeInput, T extends Recipe<I>> Optional<RecipeEntry<T>> getFirstMatch(RecipeType<T> type, I input, World world, @Nullable @Nullable RegistryKey<Recipe<?>> registryKey)
      Mappings:
      Namespace Name Mixin selector
      named getFirstMatch Lnet/minecraft/recipe/RecipeManager;getFirstMatch(Lnet/minecraft/recipe/RecipeType;Lnet/minecraft/recipe/input/RecipeInput;Lnet/minecraft/world/World;Lnet/minecraft/registry/RegistryKey;)Ljava/util/Optional;
      intermediary method_42299 Lnet/minecraft/class_1863;method_42299(Lnet/minecraft/class_3956;Lnet/minecraft/class_9695;Lnet/minecraft/class_1937;Lnet/minecraft/class_5321;)Ljava/util/Optional;
      official a Ldcf;a(Ldcj;Ldce;Ldha;Laly;)Ljava/util/Optional;
    • getFirstMatch

      public <I extends RecipeInput, T extends Recipe<I>> Optional<RecipeEntry<T>> getFirstMatch(RecipeType<T> type, I input, World world, @Nullable @Nullable RecipeEntry<T> recipe)
      Mappings:
      Namespace Name Mixin selector
      named getFirstMatch Lnet/minecraft/recipe/RecipeManager;getFirstMatch(Lnet/minecraft/recipe/RecipeType;Lnet/minecraft/recipe/input/RecipeInput;Lnet/minecraft/world/World;Lnet/minecraft/recipe/RecipeEntry;)Ljava/util/Optional;
      intermediary method_59993 Lnet/minecraft/class_1863;method_59993(Lnet/minecraft/class_3956;Lnet/minecraft/class_9695;Lnet/minecraft/class_1937;Lnet/minecraft/class_8786;)Ljava/util/Optional;
      official a Ldcf;a(Ldcj;Ldce;Ldha;Ldcd;)Ljava/util/Optional;
    • getFirstMatch

      public <I extends RecipeInput, T extends Recipe<I>> Optional<RecipeEntry<T>> getFirstMatch(RecipeType<T> type, I input, World world)
      Returns a recipe of the given type that match the given inventory and world.

      If there are multiple matching recipes, the result is arbitrary, but this method will return the same result unless the recipes in this manager are updated.

      Parameters:
      type - the desired recipe type
      world - the input world
      Returns:
      a recipe of the given type that match the given inventory and world
      Mappings:
      Namespace Name Mixin selector
      named getFirstMatch Lnet/minecraft/recipe/RecipeManager;getFirstMatch(Lnet/minecraft/recipe/RecipeType;Lnet/minecraft/recipe/input/RecipeInput;Lnet/minecraft/world/World;)Ljava/util/Optional;
      intermediary method_8132 Lnet/minecraft/class_1863;method_8132(Lnet/minecraft/class_3956;Lnet/minecraft/class_9695;Lnet/minecraft/class_1937;)Ljava/util/Optional;
      official a Ldcf;a(Ldcj;Ldce;Ldha;)Ljava/util/Optional;
    • get

      public Optional<RecipeEntry<?>> get(RegistryKey<Recipe<?>> registryKey)
      Returns a recipe with the given id, or empty if there is no such recipe.
      Returns:
      a recipe with the given id, or empty if there is no such recipe
      Mappings:
      Namespace Name Mixin selector
      named get Lnet/minecraft/recipe/RecipeManager;get(Lnet/minecraft/registry/RegistryKey;)Ljava/util/Optional;
      intermediary method_8130 Lnet/minecraft/class_1863;method_8130(Lnet/minecraft/class_5321;)Ljava/util/Optional;
      official b Ldcf;b(Laly;)Ljava/util/Optional;
    • get

      @Nullable private <T extends Recipe<?>> @Nullable RecipeEntry<T> get(RecipeType<T> type, RegistryKey<Recipe<?>> registryKey)
      Returns a recipe with the given id and type, or empty if there is no such recipe.
      Parameters:
      type - the type of the desired recipe
      Returns:
      a recipe with the given id and type, or empty if there is no such recipe
      Mappings:
      Namespace Name Mixin selector
      named get Lnet/minecraft/recipe/RecipeManager;get(Lnet/minecraft/recipe/RecipeType;Lnet/minecraft/registry/RegistryKey;)Lnet/minecraft/recipe/RecipeEntry;
      intermediary method_59821 Lnet/minecraft/class_1863;method_59821(Lnet/minecraft/class_3956;Lnet/minecraft/class_5321;)Lnet/minecraft/class_8786;
      official a Ldcf;a(Ldcj;Laly;)Ldcd;
    • method_64692

      public Map<RegistryKey<class_10290>,class_10290> method_64692()
      Mappings:
      Namespace Name Mixin selector
      named method_64692 Lnet/minecraft/recipe/RecipeManager;method_64692()Ljava/util/Map;
      intermediary method_64692 Lnet/minecraft/class_1863;method_64692()Ljava/util/Map;
      official b Ldcf;b()Ljava/util/Map;
    • method_64694

      Mappings:
      Namespace Name Mixin selector
      named method_64694 Lnet/minecraft/recipe/RecipeManager;method_64694()Lnet/minecraft/class_10291$class_10293;
      intermediary method_64694 Lnet/minecraft/class_1863;method_64694()Lnet/minecraft/class_10291$class_10293;
      official d Ldcf;d()Ldcl$b;
    • method_64678

      public class_10290 method_64678(RegistryKey<class_10290> registryKey)
      Specified by:
      method_64678 in interface class_10286
      Mappings:
      Namespace Name Mixin selector
      named method_64678 Lnet/minecraft/class_10286;method_64678(Lnet/minecraft/registry/RegistryKey;)Lnet/minecraft/class_10290;
      intermediary method_64678 Lnet/minecraft/class_10286;method_64678(Lnet/minecraft/class_5321;)Lnet/minecraft/class_10290;
      official a Ldca;a(Laly;)Ldch;
    • method_64677

      Specified by:
      method_64677 in interface class_10286
      Mappings:
      Namespace Name Mixin selector
      named method_64677 Lnet/minecraft/class_10286;method_64677()Lnet/minecraft/class_10291$class_10293;
      intermediary method_64677 Lnet/minecraft/class_10286;method_64677()Lnet/minecraft/class_10291$class_10293;
      official a Ldca;a()Ldcl$b;
    • values

      public Collection<RecipeEntry<?>> values()
      Returns all recipes in this manager.

      The returned set does not update with the manager. Modifications to the returned set does not affect this manager.

      Returns:
      all recipes in this manager
      Mappings:
      Namespace Name Mixin selector
      named values Lnet/minecraft/recipe/RecipeManager;values()Ljava/util/Collection;
      intermediary method_8126 Lnet/minecraft/class_1863;method_8126()Ljava/util/Collection;
      official e Ldcf;e()Ljava/util/Collection;
    • method_64686

      @Nullable public @Nullable RecipeManager.class_10288 method_64686(class_10298 class_10298)
      Mappings:
      Namespace Name Mixin selector
      named method_64686 Lnet/minecraft/recipe/RecipeManager;method_64686(Lnet/minecraft/class_10298;)Lnet/minecraft/recipe/RecipeManager$class_10288;
      intermediary method_64686 Lnet/minecraft/class_1863;method_64686(Lnet/minecraft/class_10298;)Lnet/minecraft/class_1863$class_10288;
      official a Ldcf;a(Ldde;)Ldcf$b;
    • method_64679

      public void method_64679(RegistryKey<Recipe<?>> registryKey, Consumer<class_10297> consumer)
      Mappings:
      Namespace Name Mixin selector
      named method_64679 Lnet/minecraft/recipe/RecipeManager;method_64679(Lnet/minecraft/registry/RegistryKey;Ljava/util/function/Consumer;)V
      intermediary method_64679 Lnet/minecraft/class_1863;method_64679(Lnet/minecraft/class_5321;Ljava/util/function/Consumer;)V
      official a Ldcf;a(Laly;Ljava/util/function/Consumer;)V
    • deserialize

      protected static RecipeEntry<?> deserialize(RegistryKey<Recipe<?>> registryKey, JsonObject json, RegistryWrapper.WrapperLookup registries)
      Reads a recipe from a JSON object.
      Returns:
      the read recipe
      Throws:
      JsonParseException - if the recipe JSON is invalid
      Implementation Note:
      Even though a recipe's serializer is stored in a type field in the JSON format and referred so in this method, its registry has key minecraft:root/minecraft:recipe_serializer and is thus named.
      Mappings:
      Namespace Name Mixin selector
      named deserialize Lnet/minecraft/recipe/RecipeManager;deserialize(Lnet/minecraft/registry/RegistryKey;Lcom/google/gson/JsonObject;Lnet/minecraft/registry/RegistryWrapper$WrapperLookup;)Lnet/minecraft/recipe/RecipeEntry;
      intermediary method_17720 Lnet/minecraft/class_1863;method_17720(Lnet/minecraft/class_5321;Lcom/google/gson/JsonObject;Lnet/minecraft/class_7225$class_7874;)Lnet/minecraft/class_8786;
      official a Ldcf;a(Laly;Lcom/google/gson/JsonObject;Ljs$a;)Ldcd;
    • createCachedMatchGetter

      public static <I extends RecipeInput, T extends Recipe<I>> RecipeManager.MatchGetter<I,T> createCachedMatchGetter(RecipeType<T> type)
      Creates a cached match getter. This is optimized for getting matches of the same recipe repeatedly, such as furnaces.
      Mappings:
      Namespace Name Mixin selector
      named createCachedMatchGetter Lnet/minecraft/recipe/RecipeManager;createCachedMatchGetter(Lnet/minecraft/recipe/RecipeType;)Lnet/minecraft/recipe/RecipeManager$MatchGetter;
      intermediary method_42302 Lnet/minecraft/class_1863;method_42302(Lnet/minecraft/class_3956;)Lnet/minecraft/class_1863$class_7266;
      official a Ldcf;a(Ldcj;)Ldcf$a;
    • method_64688

      private static List<RecipeManager.class_10288> method_64688(Iterable<RecipeEntry<?>> iterable, FeatureSet featureSet)
      Mappings:
      Namespace Name Mixin selector
      named method_64688 Lnet/minecraft/recipe/RecipeManager;method_64688(Ljava/lang/Iterable;Lnet/minecraft/resource/featuretoggle/FeatureSet;)Ljava/util/List;
      intermediary method_64688 Lnet/minecraft/class_1863;method_64688(Ljava/lang/Iterable;Lnet/minecraft/class_7699;)Ljava/util/List;
      official a Ldcf;a(Ljava/lang/Iterable;Lcso;)Ljava/util/List;