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 interfaceRecipeManager.CachedCheck<I extends RecipeInput,T extends Recipe<I>> static classstatic interfacestatic final recordNested classes/interfaces inherited from interface net.minecraft.server.packs.resources.PreparableReloadListener
PreparableReloadListener.PreparationBarrier, PreparableReloadListener.SharedState, PreparableReloadListener.StateKey<T> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate List<RecipeManager.ServerDisplayInfo> private static final org.slf4j.Loggerprivate Map<ResourceKey<RecipePropertySet>, RecipePropertySet> private static final FileToIdConverterprivate static final Map<ResourceKey<RecipePropertySet>, RecipeManager.IngredientExtractor> private it.unimi.dsi.fastutil.objects.Object2IntMap<ResourceKey<Recipe<?>>> private RecipeMapprivate Map<ResourceKey<Recipe<?>>, List<RecipeManager.ServerDisplayInfo>> private final HolderLookup.Provider -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidapply(RecipeMap p_380231_, ResourceManager p_44038_, ProfilerFiller p_44039_) 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) voidfinalizeRecipeLoading(FeatureFlagSet pEnabledFeatures) private static RecipeManager.IngredientExtractorforSingleInput(RecipeType<? extends SingleItemRecipe> pRecipeType) protected static RecipeHolder<?> fromJson(ResourceKey<Recipe<?>> pRecipe, JsonObject pJson, HolderLookup.Provider pRegistries) <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 booleanisIngredientEnabled(FeatureFlagSet pEnabledFeatures, Ingredient pIngredient) voidlistDisplaysForRecipe(ResourceKey<Recipe<?>> pRecipe, Consumer<RecipeDisplayEntry> pOutput) protected RecipeMapprepare(ResourceManager p_379845_, ProfilerFiller p_380058_) Performs any reloading that can be done off-thread, such as file IOpropertySet(ResourceKey<RecipePropertySet> p_379366_) voidsetPriorityMap(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
reloadMethods inherited from class net.neoforged.neoforge.resource.ContextAwareReloadListener
getContext, getRegistryLookup, injectContext, makeConditionalOps, makeConditionalOpsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.server.packs.resources.PreparableReloadListener
getName, prepareSharedState
-
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
Description copied from class:SimplePreparableReloadListenerPerforms any reloading that can be done off-thread, such as file IO- Specified by:
preparein classSimplePreparableReloadListener<RecipeMap>
-
apply
- Specified by:
applyin 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:
propertySetin interfaceRecipeAccess
-
stonecutterRecipes
- Specified by:
stonecutterRecipesin interfaceRecipeAccess
-
getRecipes
-
getRecipeFromDisplay
-
listDisplaysForRecipe
public void listDisplaysForRecipe(ResourceKey<Recipe<?>> pRecipe, Consumer<RecipeDisplayEntry> pOutput) -
fromJson
protected static RecipeHolder<?> fromJson(ResourceKey<Recipe<?>> pRecipe, JsonObject pJson, HolderLookup.Provider pRegistries) -
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)
-