public class RecipeManager extends JsonDataLoader
ResourceReloadListener.Synchronizer
Modifier and Type | Field and Description |
---|---|
private boolean |
errored |
private static Gson |
GSON |
private static Logger |
LOGGER |
private Map<RecipeType<?>,Map<Identifier,Recipe<?>>> |
recipes |
Constructor and Description |
---|
RecipeManager() |
Modifier and Type | Method and Description |
---|---|
protected void |
apply(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>> |
getAllMatches(RecipeType<T> type,
C inventory,
World world) |
private <C extends Inventory,T extends Recipe<C>> |
getAllOfType(RecipeType<T> type) |
<C extends Inventory,T extends Recipe<C>> |
getFirstMatch(RecipeType<T> type,
C inventory,
World world) |
<C extends Inventory,T extends Recipe<C>> |
getRemainingStacks(RecipeType<T> recipeType,
C c,
World world) |
Stream<Identifier> |
keys() |
<C extends Inventory,T extends Recipe<C>> |
listAllOfType(RecipeType<T> recipeType)
Creates a list of all recipes of the given type.
|
void |
setRecipes(Iterable<Recipe<?>> recipes) |
Collection<Recipe<?>> |
values() |
prepare
reload
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getName
private static final Gson GSON
private static final Logger LOGGER
private Map<RecipeType<?>,Map<Identifier,Recipe<?>>> recipes
private boolean errored
protected void apply(Map<Identifier,JsonElement> map, ResourceManager resourceManager, Profiler profiler)
apply
in class SinglePreparationResourceReloadListener<Map<Identifier,JsonElement>>
public <C extends Inventory,T extends Recipe<C>> Optional<T> getFirstMatch(RecipeType<T> type, C inventory, World world)
public <C extends Inventory,T extends Recipe<C>> List<T> listAllOfType(RecipeType<T> recipeType)
public <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)
public <C extends Inventory,T extends Recipe<C>> DefaultedList<ItemStack> getRemainingStacks(RecipeType<T> recipeType, C c, World world)
public Optional<? extends Recipe<?>> get(Identifier id)
public Collection<Recipe<?>> values()
public Stream<Identifier> keys()
public static Recipe<?> deserialize(Identifier id, JsonObject json)