Skip to content

Instantly share code, notes, and snippets.

@P3pp3rF1y
P3pp3rF1y / RecipeToJson.java
Last active September 20, 2017 20:28
williewillus's recipe json dumper enhanced a bit
// Replace calls to GameRegistry.addShapeless/ShapedRecipe with these methods, which will dump it to a json in your dir of choice
// Also works with OD, replace GameRegistry.addRecipe(new ShapedOreRecipe/ShapelessOreRecipe with the same calls
private static final Gson GSON = new GsonBuilder().setPrettyPrinting().create();
private static File RECIPE_DIR = null;
private static final Set<String> USED_OD_NAMES = new TreeSet<>();
private static void setupDir() {
if (RECIPE_DIR == null) {
RECIPE_DIR = ConfigurationHandler.configuration.getConfigFile().toPath().resolve("../recipes/").toFile();