Skip to content

Instantly share code, notes, and snippets.

As a contributor to any and all **Sophisticated Mods GitHub repositories** (including but not limited to **SophisticatedCore, Sophisticated Storage, and Sophisticated Backpacks**), unless a more specific CLA has already been signed for a particular codebase, you grant **P3pp3rF1y** the following:
Complete copyright ownership of your contributions, including but not limited to **code of any form and digital assets**, to the codebase of **Sophisticated Mods**, where they will be licensed under **All Rights Reserved (ARR)**.
**Translations are an exception** and remain **freely available**, meaning they may be used, modified, and shared without restriction.
This is intended as a legally binding copyright assignment to **P3pp3rF1y** for all contributions to any of the Sophisticated Mods repositories.
@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();