Package net.minecraft.recipe
Class RecipeManager
java.lang.Object
net.minecraft.resource.SinglePreparationResourceReloadListener<Map<Identifier,JsonElement>>
net.minecraft.resource.JsonDataLoader
net.minecraft.recipe.RecipeManager
- All Implemented Interfaces:
ResourceReloadListener
public class RecipeManager extends JsonDataLoader
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.resource.ResourceReloadListener
ResourceReloadListener.Synchronizer -
Field Summary
-
Constructor Summary
Constructors Constructor Description RecipeManager() -
Method Summary
Modifier and Type Method Description protected voidapply(Map<Identifier,JsonElement> map, ResourceManager resourceManager, Profiler profiler)static Recipe<?>deserialize(Identifier id, JsonObject json)Optional<? extends Recipe<?>>get(Identifier id)<C extends Inventory, T extends Recipe<C>>
List<T>getAllMatches(RecipeType<T> type, C inventory, World world)private <C extends Inventory, T extends Recipe<C>>
Map<Identifier,Recipe<C>>getAllOfType(RecipeType<T> type)<C extends Inventory, T extends Recipe<C>>
Optional<T>getFirstMatch(RecipeType<T> type, C inventory, World world)<C extends Inventory, T extends Recipe<C>>
DefaultedList<ItemStack>getRemainingStacks(RecipeType<T> recipeType, C c, World world)Stream<Identifier>keys()<C extends Inventory, T extends Recipe<C>>
List<T>listAllOfType(RecipeType<T> recipeType)Creates a list of all recipes of the given type.voidsetRecipes(Iterable<Recipe<?>> recipes)Collection<Recipe<?>>values()Methods inherited from class net.minecraft.resource.JsonDataLoader
prepareMethods inherited from class net.minecraft.resource.SinglePreparationResourceReloadListener
reloadMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.resource.ResourceReloadListener
getName
-
Field Details
-
GSON
-
LOGGER
-
recipes
-
errored
private boolean errored
-
-
Constructor Details
-
RecipeManager
public RecipeManager()
-
-
Method Details
-
apply
protected void apply(Map<Identifier,JsonElement> map, ResourceManager resourceManager, Profiler profiler)- Specified by:
applyin classSinglePreparationResourceReloadListener<Map<Identifier,JsonElement>>
-
getFirstMatch
public <C extends Inventory, T extends Recipe<C>> Optional<T> getFirstMatch(RecipeType<T> type, C inventory, World world) -
listAllOfType
Creates a list of all recipes of the given type. Modifications to the returned list do not affect the manager. -
getAllMatches
public <C extends Inventory, T extends Recipe<C>> List<T> getAllMatches(RecipeType<T> type, C inventory, World world) -
getAllOfType
private <C extends Inventory, T extends Recipe<C>> Map<Identifier,Recipe<C>> getAllOfType(RecipeType<T> type) -
getRemainingStacks
public <C extends Inventory, T extends Recipe<C>> DefaultedList<ItemStack> getRemainingStacks(RecipeType<T> recipeType, C c, World world) -
get
-
values
-
keys
-
deserialize
-
setRecipes
-