Class RecipeManager
java.lang.Object
net.neoforged.neoforge.resource.ContextAwareReloadListener
net.minecraft.server.packs.resources.SimplePreparableReloadListener<Map<ResourceLocation,com.google.gson.JsonElement>>
net.minecraft.server.packs.resources.SimpleJsonResourceReloadListener
net.minecraft.world.item.crafting.RecipeManager
- All Implemented Interfaces:
PreparableReloadListener
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
RecipeManager.CachedCheck<I extends RecipeInput,
T extends Recipe<I>> Nested classes/interfaces inherited from interface net.minecraft.server.packs.resources.PreparableReloadListener
PreparableReloadListener.PreparationBarrier
-
Field Summary
Modifier and TypeFieldDescriptionprivate Map
<ResourceLocation, RecipeHolder<?>> private com.google.common.collect.Multimap
<RecipeType<?>, RecipeHolder<?>> private static final com.google.gson.Gson
private boolean
private static final org.slf4j.Logger
private final HolderLookup.Provider
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
apply
(Map<ResourceLocation, com.google.gson.JsonElement> p_44037_, ResourceManager p_44038_, ProfilerFiller p_44039_) Optional
<RecipeHolder<?>> byKey
(ResourceLocation p_44044_) private <T extends Recipe<?>>
RecipeHolder<T> byKeyTyped
(RecipeType<T> p_341695_, ResourceLocation p_341666_) private <I extends RecipeInput,
T extends Recipe<I>>
Collection<RecipeHolder<T>> byType
(RecipeType<T> p_44055_) static <I extends RecipeInput,
T extends Recipe<I>>
RecipeManager.CachedCheck<I, T> createCheck
(RecipeType<T> p_220268_) protected static RecipeHolder
<?> fromJson
(ResourceLocation p_44046_, com.google.gson.JsonObject p_44047_, HolderLookup.Provider p_323755_) <I extends RecipeInput,
T extends Recipe<I>>
List<RecipeHolder<T>> getAllRecipesFor
(RecipeType<T> p_44014_) <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_, ResourceLocation p_346260_) <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_) <I extends RecipeInput,
T extends Recipe<I>>
List<RecipeHolder<T>> getRecipesFor
(RecipeType<T> p_44057_, I p_346353_, Level p_44059_) <I extends RecipeInput,
T extends Recipe<I>>
NonNullList<ItemStack> getRemainingItemsFor
(RecipeType<T> p_44070_, I p_345118_, Level p_44072_) boolean
void
replaceRecipes
(Iterable<RecipeHolder<?>> p_44025_) Methods inherited from class net.minecraft.server.packs.resources.SimpleJsonResourceReloadListener
getPreparedPath, prepare, scanDirectory
Methods inherited from class net.minecraft.server.packs.resources.SimplePreparableReloadListener
reload
Methods inherited from class net.neoforged.neoforge.resource.ContextAwareReloadListener
getContext, getRegistryLookup, injectContext, 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
-
GSON
private static final com.google.gson.Gson GSON -
LOGGER
private static final org.slf4j.Logger LOGGER -
registries
-
byType
-
byName
-
hasErrors
private boolean hasErrors
-
-
Constructor Details
-
RecipeManager
-
-
Method Details
-
apply
protected void apply(Map<ResourceLocation, com.google.gson.JsonElement> p_44037_, ResourceManager p_44038_, ProfilerFiller p_44039_) - Specified by:
apply
in classSimplePreparableReloadListener<Map<ResourceLocation,
com.google.gson.JsonElement>>
-
hadErrorsLoading
public boolean hadErrorsLoading() -
getRecipeFor
public <I extends RecipeInput,T extends Recipe<I>> Optional<RecipeHolder<T>> getRecipeFor(RecipeType<T> p_44016_, I p_345492_, Level p_44018_) -
getRecipeFor
public <I extends RecipeInput,T extends Recipe<I>> Optional<RecipeHolder<T>> getRecipeFor(RecipeType<T> p_345895_, I p_345268_, Level p_346336_, @Nullable ResourceLocation p_346260_) -
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_) -
getAllRecipesFor
public <I extends RecipeInput,T extends Recipe<I>> List<RecipeHolder<T>> getAllRecipesFor(RecipeType<T> p_44014_) -
getRecipesFor
public <I extends RecipeInput,T extends Recipe<I>> List<RecipeHolder<T>> getRecipesFor(RecipeType<T> p_44057_, I p_346353_, Level p_44059_) -
byType
private <I extends RecipeInput,T extends Recipe<I>> Collection<RecipeHolder<T>> byType(RecipeType<T> p_44055_) -
getRemainingItemsFor
public <I extends RecipeInput,T extends Recipe<I>> NonNullList<ItemStack> getRemainingItemsFor(RecipeType<T> p_44070_, I p_345118_, Level p_44072_) -
byKey
-
byKeyTyped
@Nullable private <T extends Recipe<?>> RecipeHolder<T> byKeyTyped(RecipeType<T> p_341695_, ResourceLocation p_341666_) -
getOrderedRecipes
-
getRecipes
-
getRecipeIds
-
fromJson
protected static RecipeHolder<?> fromJson(ResourceLocation p_44046_, com.google.gson.JsonObject p_44047_, HolderLookup.Provider p_323755_) -
replaceRecipes
-
createCheck
public static <I extends RecipeInput,T extends Recipe<I>> RecipeManager.CachedCheck<I,T> createCheck(RecipeType<T> p_220268_)
-