public class CraftingHelper
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
CraftingHelper.FactoryLoader<T> |
static class |
CraftingHelper.ShapedPrimer |
Modifier and Type | Field and Description |
---|---|
private static java.util.Map<ResourceLocation,IConditionFactory> |
conditions |
static CraftingHelper.FactoryLoader<IConditionFactory> |
CONDITIONS |
private static boolean |
DEBUG_LOAD_MINECRAFT |
static com.google.gson.Gson |
GSON |
private static java.util.Map<ResourceLocation,IIngredientFactory> |
ingredients |
static CraftingHelper.FactoryLoader<IIngredientFactory> |
INGREDIENTS |
private static java.util.Map<ResourceLocation,IRecipeFactory> |
recipes |
static CraftingHelper.FactoryLoader<IRecipeFactory> |
RECIPES |
Constructor and Description |
---|
CraftingHelper() |
Modifier and Type | Method and Description |
---|---|
static boolean |
findFiles(ModContainer mod,
java.lang.String base,
java.util.function.Function<java.nio.file.Path,java.lang.Boolean> preprocessor,
java.util.function.BiFunction<java.nio.file.Path,java.nio.file.Path,java.lang.Boolean> processor)
Deprecated.
|
static boolean |
findFiles(ModContainer mod,
java.lang.String base,
java.util.function.Function<java.nio.file.Path,java.lang.Boolean> preprocessor,
java.util.function.BiFunction<java.nio.file.Path,java.nio.file.Path,java.lang.Boolean> processor,
boolean defaultUnfoundRoot)
Deprecated.
|
static boolean |
findFiles(ModContainer mod,
java.lang.String base,
java.util.function.Function<java.nio.file.Path,java.lang.Boolean> preprocessor,
java.util.function.BiFunction<java.nio.file.Path,java.nio.file.Path,java.lang.Boolean> processor,
boolean defaultUnfoundRoot,
boolean visitAllFiles) |
private static <T> T |
getClassInstance(java.lang.String clsName,
java.lang.Class<T> expected) |
static java.util.function.BooleanSupplier |
getCondition(com.google.gson.JsonObject json,
JsonContext context) |
static Ingredient |
getIngredient(com.google.gson.JsonElement json,
JsonContext context) |
static Ingredient |
getIngredient(java.lang.Object obj) |
static ItemStack |
getItemStack(com.google.gson.JsonObject json,
JsonContext context) |
static ItemStack |
getItemStackBasic(com.google.gson.JsonObject json,
JsonContext context) |
static IRecipe |
getRecipe(com.google.gson.JsonObject json,
JsonContext context) |
static void |
init() |
private static JsonContext |
loadContext(JsonContext ctx,
java.io.File file) |
private static JsonContext |
loadContext(ModContainer mod,
JsonContext ctx,
ResourceLocation path) |
static JsonContext |
loadContext(ResourceLocation path) |
static JsonContext |
loadContext(ResourceLocation path,
ModContainer mod) |
private static void |
loadFactories(com.google.gson.JsonObject json,
JsonContext context,
CraftingHelper.FactoryLoader... loaders) |
private static void |
loadFactories(ModContainer mod) |
static void |
loadFactories(ModContainer mod,
java.lang.String base,
CraftingHelper.FactoryLoader... loaders) |
private static <T> void |
loadFactory(com.google.gson.JsonObject json,
JsonContext context,
CraftingHelper.FactoryLoader<T> loader) |
static void |
loadRecipes(boolean revertFrozen) |
private static boolean |
loadRecipes(ModContainer mod) |
static CraftingHelper.ShapedPrimer |
parseShaped(java.lang.Object... recipe) |
static boolean |
processConditions(com.google.gson.JsonArray conditions,
JsonContext context) |
static boolean |
processConditions(com.google.gson.JsonObject json,
java.lang.String memberName,
JsonContext context) |
static void |
register(ResourceLocation key,
IConditionFactory factory) |
static void |
register(ResourceLocation key,
IIngredientFactory factory) |
static void |
register(ResourceLocation key,
IRecipeFactory factory) |
private static void |
registerC(java.lang.String name,
IConditionFactory fac) |
private static void |
registerI(java.lang.String name,
IIngredientFactory fac) |
private static void |
registerR(java.lang.String name,
IRecipeFactory fac) |
private static final boolean DEBUG_LOAD_MINECRAFT
public static final com.google.gson.Gson GSON
private static final java.util.Map<ResourceLocation,IConditionFactory> conditions
private static final java.util.Map<ResourceLocation,IIngredientFactory> ingredients
private static final java.util.Map<ResourceLocation,IRecipeFactory> recipes
public static final CraftingHelper.FactoryLoader<IIngredientFactory> INGREDIENTS
public static final CraftingHelper.FactoryLoader<IRecipeFactory> RECIPES
public static final CraftingHelper.FactoryLoader<IConditionFactory> CONDITIONS
public static void register(ResourceLocation key, IConditionFactory factory)
public static void register(ResourceLocation key, IRecipeFactory factory)
public static void register(ResourceLocation key, IIngredientFactory factory)
public static Ingredient getIngredient(java.lang.Object obj)
@Nonnull public static Ingredient getIngredient(com.google.gson.JsonElement json, JsonContext context)
public static ItemStack getItemStack(com.google.gson.JsonObject json, JsonContext context)
public static ItemStack getItemStackBasic(com.google.gson.JsonObject json, JsonContext context)
public static CraftingHelper.ShapedPrimer parseShaped(java.lang.Object... recipe)
public static boolean processConditions(com.google.gson.JsonObject json, java.lang.String memberName, JsonContext context)
public static boolean processConditions(com.google.gson.JsonArray conditions, JsonContext context)
public static java.util.function.BooleanSupplier getCondition(com.google.gson.JsonObject json, JsonContext context)
public static IRecipe getRecipe(com.google.gson.JsonObject json, JsonContext context)
public static void init()
private static void registerC(java.lang.String name, IConditionFactory fac)
private static void registerR(java.lang.String name, IRecipeFactory fac)
private static void registerI(java.lang.String name, IIngredientFactory fac)
private static void loadFactories(com.google.gson.JsonObject json, JsonContext context, CraftingHelper.FactoryLoader... loaders)
private static <T> void loadFactory(com.google.gson.JsonObject json, JsonContext context, CraftingHelper.FactoryLoader<T> loader)
private static <T> T getClassInstance(java.lang.String clsName, java.lang.Class<T> expected)
public static void loadRecipes(boolean revertFrozen)
private static void loadFactories(ModContainer mod)
public static void loadFactories(ModContainer mod, java.lang.String base, CraftingHelper.FactoryLoader... loaders)
private static boolean loadRecipes(ModContainer mod)
@Deprecated public static boolean findFiles(ModContainer mod, java.lang.String base, java.util.function.Function<java.nio.file.Path,java.lang.Boolean> preprocessor, java.util.function.BiFunction<java.nio.file.Path,java.nio.file.Path,java.lang.Boolean> processor)
findFiles(ModContainer, String, Function, BiFunction, boolean, boolean)
instead.@Deprecated public static boolean findFiles(ModContainer mod, java.lang.String base, java.util.function.Function<java.nio.file.Path,java.lang.Boolean> preprocessor, java.util.function.BiFunction<java.nio.file.Path,java.nio.file.Path,java.lang.Boolean> processor, boolean defaultUnfoundRoot)
findFiles(ModContainer, String, Function, BiFunction, boolean, boolean)
instead.public static boolean findFiles(ModContainer mod, java.lang.String base, java.util.function.Function<java.nio.file.Path,java.lang.Boolean> preprocessor, java.util.function.BiFunction<java.nio.file.Path,java.nio.file.Path,java.lang.Boolean> processor, boolean defaultUnfoundRoot, boolean visitAllFiles)
public static JsonContext loadContext(ResourceLocation path) throws java.io.IOException
java.io.IOException
public static JsonContext loadContext(ResourceLocation path, ModContainer mod) throws java.io.IOException
java.io.IOException
private static JsonContext loadContext(JsonContext ctx, java.io.File file) throws java.io.IOException
java.io.IOException
private static JsonContext loadContext(ModContainer mod, JsonContext ctx, ResourceLocation path) throws java.io.IOException
java.io.IOException