Class RecipeManager
java.lang.Object
net.neoforged.neoforge.resource.ContextAwareReloadListener
net.minecraft.server.packs.resources.SimplePreparableReloadListener<RecipeMap>
net.minecraft.world.item.crafting.RecipeManager
- All Implemented Interfaces:
PreparableReloadListener
,RecipeAccess
public class RecipeManager
extends SimplePreparableReloadListener<RecipeMap>
implements RecipeAccess
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
RecipeManager.CachedCheck<I extends RecipeInput,
T extends Recipe<I>> static class
static interface
static final record
Nested classes/interfaces inherited from interface net.minecraft.server.packs.resources.PreparableReloadListener
PreparableReloadListener.PreparationBarrier
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate List
<RecipeManager.ServerDisplayInfo> private static final org.slf4j.Logger
private Map
<ResourceKey<RecipePropertySet>, RecipePropertySet> private static final FileToIdConverter
private static final Map
<ResourceKey<RecipePropertySet>, RecipeManager.IngredientExtractor> private it.unimi.dsi.fastutil.objects.Object2IntMap
<ResourceKey<Recipe<?>>> private RecipeMap
private Map
<ResourceKey<Recipe<?>>, List<RecipeManager.ServerDisplayInfo>> private final HolderLookup.Provider
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
apply
(RecipeMap p_380231_, ResourceManager p_44038_, ProfilerFiller p_44039_) Optional
<RecipeHolder<?>> byKey
(ResourceKey<Recipe<?>> p_379753_) private <T extends Recipe<?>>
RecipeHolder<T> byKeyTyped
(RecipeType<T> p_341695_, ResourceKey<Recipe<?>> p_379841_) static <I extends RecipeInput,
T extends Recipe<I>>
RecipeManager.CachedCheck<I, T> createCheck
(RecipeType<T> p_220268_) (package private) static List
<Ingredient> filterDisabled
(FeatureFlagSet p_379504_, List<Ingredient> p_379890_) void
finalizeRecipeLoading
(FeatureFlagSet p_379660_) private static RecipeManager.IngredientExtractor
forSingleInput
(RecipeType<? extends SingleItemRecipe> p_381108_) protected static RecipeHolder
<?> fromJson
(ResourceKey<Recipe<?>> p_380059_, com.google.gson.JsonObject p_44047_, HolderLookup.Provider p_323755_) <I extends RecipeInput,
T extends Recipe<I>>
Optional<RecipeHolder<T>> getRecipeFor
(RecipeType<T> p_44016_, I p_345492_, Level p_44018_) <I extends RecipeInput,
T extends Recipe<I>>
Optional<RecipeHolder<T>> getRecipeFor
(RecipeType<T> p_345895_, I p_345268_, Level p_346336_, ResourceKey<Recipe<?>> p_380176_) <I extends RecipeInput,
T extends Recipe<I>>
Optional<RecipeHolder<T>> getRecipeFor
(RecipeType<T> p_220249_, I p_345826_, Level p_220251_, RecipeHolder<T> p_346407_) getRecipeFromDisplay
(RecipeDisplayId p_379566_) private static boolean
isIngredientEnabled
(FeatureFlagSet p_379722_, Ingredient p_380390_) void
listDisplaysForRecipe
(ResourceKey<Recipe<?>> p_379964_, Consumer<RecipeDisplayEntry> p_379437_) protected RecipeMap
prepare
(ResourceManager p_379845_, ProfilerFiller p_380058_) propertySet
(ResourceKey<RecipePropertySet> p_379366_) void
setPriorityMap
(it.unimi.dsi.fastutil.objects.Object2IntMap<ResourceKey<Recipe<?>>> recipePriorities) private static List
<RecipeManager.ServerDisplayInfo> unpackRecipeInfo
(Iterable<RecipeHolder<?>> p_379538_, FeatureFlagSet p_379868_) Methods inherited from class net.minecraft.server.packs.resources.SimplePreparableReloadListener
reload
Methods inherited from class net.neoforged.neoforge.resource.ContextAwareReloadListener
getContext, getRegistryLookup, injectContext, makeConditionalOps, makeConditionalOps
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minecraft.server.packs.resources.PreparableReloadListener
getName
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
RECIPE_PROPERTY_SETS
private static final Map<ResourceKey<RecipePropertySet>,RecipeManager.IngredientExtractor> RECIPE_PROPERTY_SETS -
RECIPE_LISTER
-
registries
-
recipes
-
propertySets
-
stonecutterRecipes
-
allDisplays
-
recipeToDisplay
-
recipePriorities
-
-
Constructor Details
-
RecipeManager
-
-
Method Details
-
prepare
- Specified by:
prepare
in classSimplePreparableReloadListener<RecipeMap>
-
apply
- Specified by:
apply
in classSimplePreparableReloadListener<RecipeMap>
-
finalizeRecipeLoading
-
filterDisabled
-
isIngredientEnabled
-
getRecipeFor
public <I extends RecipeInput,T extends Recipe<I>> Optional<RecipeHolder<T>> getRecipeFor(RecipeType<T> p_345895_, I p_345268_, Level p_346336_, @Nullable ResourceKey<Recipe<?>> p_380176_) -
getRecipeFor
public <I extends RecipeInput,T extends Recipe<I>> Optional<RecipeHolder<T>> getRecipeFor(RecipeType<T> p_220249_, I p_345826_, Level p_220251_, @Nullable RecipeHolder<T> p_346407_) -
getRecipeFor
public <I extends RecipeInput,T extends Recipe<I>> Optional<RecipeHolder<T>> getRecipeFor(RecipeType<T> p_44016_, I p_345492_, Level p_44018_) -
byKey
-
byKeyTyped
@Nullable private <T extends Recipe<?>> RecipeHolder<T> byKeyTyped(RecipeType<T> p_341695_, ResourceKey<Recipe<?>> p_379841_) -
getSynchronizedItemProperties
-
getSynchronizedStonecutterRecipes
-
propertySet
- Specified by:
propertySet
in interfaceRecipeAccess
-
stonecutterRecipes
- Specified by:
stonecutterRecipes
in interfaceRecipeAccess
-
getRecipes
-
getRecipeFromDisplay
-
listDisplaysForRecipe
public void listDisplaysForRecipe(ResourceKey<Recipe<?>> p_379964_, Consumer<RecipeDisplayEntry> p_379437_) -
fromJson
protected static RecipeHolder<?> fromJson(ResourceKey<Recipe<?>> p_380059_, com.google.gson.JsonObject p_44047_, HolderLookup.Provider p_323755_) -
createCheck
public static <I extends RecipeInput,T extends Recipe<I>> RecipeManager.CachedCheck<I,T> createCheck(RecipeType<T> p_220268_) -
unpackRecipeInfo
private static List<RecipeManager.ServerDisplayInfo> unpackRecipeInfo(Iterable<RecipeHolder<?>> p_379538_, FeatureFlagSet p_379868_) -
forSingleInput
private static RecipeManager.IngredientExtractor forSingleInput(RecipeType<? extends SingleItemRecipe> p_381108_) -
recipeMap
-
setPriorityMap
public void setPriorityMap(it.unimi.dsi.fastutil.objects.Object2IntMap<ResourceKey<Recipe<?>>> recipePriorities)
-