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 pObject, ResourceManager pResourceManager, ProfilerFiller pProfiler) Optional
<RecipeHolder<?>> byKey
(ResourceKey<Recipe<?>> pKey) private <T extends Recipe<?>>
RecipeHolder<T> byKeyTyped
(RecipeType<T> pType, ResourceKey<Recipe<?>> pKey) static <I extends RecipeInput,
T extends Recipe<I>>
RecipeManager.CachedCheck<I, T> createCheck
(RecipeType<T> pRecipeType) (package private) static List
<Ingredient> filterDisabled
(FeatureFlagSet pEnabledFeatures, List<Ingredient> pIngredients) void
finalizeRecipeLoading
(FeatureFlagSet pEnabledFeatures) private static RecipeManager.IngredientExtractor
forSingleInput
(RecipeType<? extends SingleItemRecipe> pRecipeType) 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> pRecipeType, I pInput, Level pLevel) <I extends RecipeInput,
T extends Recipe<I>>
Optional<RecipeHolder<T>> getRecipeFor
(RecipeType<T> pRecipeType, I pInput, Level pLevel, ResourceKey<Recipe<?>> pRecipe) <I extends RecipeInput,
T extends Recipe<I>>
Optional<RecipeHolder<T>> getRecipeFor
(RecipeType<T> pRecipeType, I pInput, Level pLevel, RecipeHolder<T> pLastRecipe) getRecipeFromDisplay
(RecipeDisplayId pDisplay) private static boolean
isIngredientEnabled
(FeatureFlagSet pEnabledFeatures, Ingredient pIngredient) void
listDisplaysForRecipe
(ResourceKey<Recipe<?>> pRecipe, Consumer<RecipeDisplayEntry> pOutput) protected RecipeMap
prepare
(ResourceManager pResourceManager, ProfilerFiller pProfiler) Performs any reloading that can be done off-thread, such as file IOpropertySet
(ResourceKey<RecipePropertySet> pPropertySet) void
setPriorityMap
(it.unimi.dsi.fastutil.objects.Object2IntMap<ResourceKey<Recipe<?>>> recipePriorities) private static List
<RecipeManager.ServerDisplayInfo> unpackRecipeInfo
(Iterable<RecipeHolder<?>> pRecipes, FeatureFlagSet pEnabledFeatures) 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
Performs any reloading that can be done off-thread, such as file IO- Specified by:
prepare
in classSimplePreparableReloadListener<RecipeMap>
-
apply
- Specified by:
apply
in classSimplePreparableReloadListener<RecipeMap>
-
finalizeRecipeLoading
-
filterDisabled
static List<Ingredient> filterDisabled(FeatureFlagSet pEnabledFeatures, List<Ingredient> pIngredients) -
isIngredientEnabled
-
getRecipeFor
public <I extends RecipeInput,T extends Recipe<I>> Optional<RecipeHolder<T>> getRecipeFor(RecipeType<T> pRecipeType, I pInput, Level pLevel, @Nullable ResourceKey<Recipe<?>> pRecipe) -
getRecipeFor
public <I extends RecipeInput,T extends Recipe<I>> Optional<RecipeHolder<T>> getRecipeFor(RecipeType<T> pRecipeType, I pInput, Level pLevel, @Nullable RecipeHolder<T> pLastRecipe) -
getRecipeFor
public <I extends RecipeInput,T extends Recipe<I>> Optional<RecipeHolder<T>> getRecipeFor(RecipeType<T> pRecipeType, I pInput, Level pLevel) -
byKey
-
byKeyTyped
@Nullable private <T extends Recipe<?>> RecipeHolder<T> byKeyTyped(RecipeType<T> pType, ResourceKey<Recipe<?>> pKey) -
getSynchronizedItemProperties
-
getSynchronizedStonecutterRecipes
-
propertySet
- Specified by:
propertySet
in interfaceRecipeAccess
-
stonecutterRecipes
- Specified by:
stonecutterRecipes
in interfaceRecipeAccess
-
getRecipes
-
getRecipeFromDisplay
-
listDisplaysForRecipe
public void listDisplaysForRecipe(ResourceKey<Recipe<?>> pRecipe, Consumer<RecipeDisplayEntry> pOutput) -
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> pRecipeType) -
unpackRecipeInfo
private static List<RecipeManager.ServerDisplayInfo> unpackRecipeInfo(Iterable<RecipeHolder<?>> pRecipes, FeatureFlagSet pEnabledFeatures) -
forSingleInput
private static RecipeManager.IngredientExtractor forSingleInput(RecipeType<? extends SingleItemRecipe> pRecipeType) -
recipeMap
-
setPriorityMap
public void setPriorityMap(it.unimi.dsi.fastutil.objects.Object2IntMap<ResourceKey<Recipe<?>>> recipePriorities)
-