From 6a93df78b95691f541fb26d96bc77a4774a4dbdf Mon Sep 17 00:00:00 2001 From: Lucas Niewohner Date: Tue, 9 Jan 2024 23:21:33 -0700 Subject: [PATCH] Some configuration and a README that is fairly optimistic about how much I'm going to accomplish --- LICENSE-template => LICENSE | 0 README.md | 25 +++++++++++++++++++ gradle.properties | 12 ++++----- .../nerd}/ClientProxy.java | 2 +- .../nerd}/CommonProxy.java | 6 ++--- .../mymodid => hermanoid/nerd}/Config.java | 2 +- .../nerd/NotEnoughRecipeDumps.java} | 6 ++--- 7 files changed, 39 insertions(+), 14 deletions(-) rename LICENSE-template => LICENSE (100%) create mode 100644 README.md rename src/main/java/com/{myname/mymodid => hermanoid/nerd}/ClientProxy.java (88%) rename src/main/java/com/{myname/mymodid => hermanoid/nerd}/CommonProxy.java (85%) rename src/main/java/com/{myname/mymodid => hermanoid/nerd}/Config.java (94%) rename src/main/java/com/{myname/mymodid/MyMod.java => hermanoid/nerd/NotEnoughRecipeDumps.java} (89%) diff --git a/LICENSE-template b/LICENSE similarity index 100% rename from LICENSE-template rename to LICENSE diff --git a/README.md b/README.md new file mode 100644 index 0000000..748bbac --- /dev/null +++ b/README.md @@ -0,0 +1,25 @@ +## NERD - Not Enough Recipe Dumps + +--- + +At long last, you can finally export all that delicious recipe data from just about every mod, automatically, into one huge and hideous dump file! + + +This (somewhat) simple project adds an extra dump option to the NEI data dumps screen (Lower-left of inventory screen>Tools>Dumps). +Why would you ever want this? Well, sometimes, those of us foolish enough to take on the GTNewHorizons modpack look up from our sprawling platline/titanium/whatever spreadsheets (I know, this is already sounding unrealistic), and we think, "boy wouldn't it be nice if I could write a script to calculate this crap." But to manually enter recipe data into a script like some sort of __plebian?__ *scoff* + +### But why do it this ugly way? + +Other methods of accessing recipe data are limited. You can: +1. Dig up crafting .json files, but those are almost strictly limited to vanilla shaped/shapeless crafting recipes. Most mods don't even do this, and instead add crafting recipes programmatically at game startup. +2. Dig into the mod's source code. Some mods (notably AE2) have non-sucky ways of storing recipes in nice config files. +3. Write a mods that interfaces with a mod's own recipe implementation. GT5-Unofficial sports a *chonking* RecipeMap that's actually quite nice. +4. Probably something else I didn't see while spiralling through layers of there-has-to-be-a-path-where-I-don't-write-Java denial. + +But each of these approaches are limited in how many recipes they can dig up. If you really want *all* recipes for something, there's only one end-all place to get it - NotEnoughItem's GUI. And so that's exactly where this mod looks. + +Every mod that integrates with NEI provides one or more recipe handlers. When you ask for how to make/use an item, NEI queries all registered handlers (in the GTNH fork of NEI, this happens [mostly] in parallel). Each handler that offers at least one recipe for that query, becomes a tab in the resulting GUI. + +These handlers are rich with all sorts of UI stuff - we're digging into a UI system, after all. But this dumper ain't got time for that. It iterates through every item in the item panel (the list of all items you can see/search) and queries all recipe handlers for how to craft that item. They return a bunch of UI stuff for drawing those recipes to the screen. NERD ignores all that stuff and scrapes item details, other associated items (e.g. fuel), and some extra metadata when it's available (mostly targeted at Gregtech b/c that's what the author cares about, sorry). This all gets dumped into one chonky-lad JSON file. + +This JSON file is hideous and has a number of problems. Fuel, for example, cycles on-screen through everything you could use as fuel. This dumper just grabs the first item in that cycle, the sapling. There's a lot of work that could be done to pretty things up. If you're willing to do that and PR it, by all means. I've elected to do this cleaning in Python because Python less suck. diff --git a/gradle.properties b/gradle.properties index 714d3d4..d4ac4d3 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,9 +1,9 @@ -modName = MyMod +modName = NotEnoughRecipeDumps # This is a case-sensitive string to identify your mod. Convention is to use lower case. -modId = mymodid +modId = notenoughrecipedumps -modGroup = com.myname.mymodid +modGroup = com.hermanoid.nerd # WHY is there no version field? # The build script relies on git to provide a version via tags. It is super easy and will enable you to always know the @@ -37,7 +37,7 @@ enableModernJavaSyntax = true enableGenericInjection = false # Generate a class with String fields for the mod id, name, version and group name named with the fields below -generateGradleTokenClass = com.myname.mymodid.Tags +generateGradleTokenClass = com.hermanoid.nerd.Tags gradleTokenModId = MODID gradleTokenModName = MODNAME gradleTokenVersion = VERSION @@ -52,7 +52,7 @@ replaceGradleTokenInFile = # In case your mod provides an API for other mods to implement you may declare its package here. Otherwise, you can # leave this property empty. -# Example value: apiPackage = api + modGroup = com.myname.mymodid -> com.myname.mymodid.api +# Example value: apiPackage = api + modGroup = com.hermanoid.nerd -> com.hermanoid.nerd.api apiPackage = # Specify the configuration file for Forge's access transformers here. It must be placed into /src/main/resources/META-INF/ @@ -70,7 +70,7 @@ mixinPlugin = mixinsPackage = # Specify the core mod entry class if you use a core mod. This class must implement IFMLLoadingPlugin! # This parameter is for legacy compatibility only -# Example value: coreModClass = asm.FMLPlugin + modGroup = com.myname.mymodid -> com.myname.mymodid.asm.FMLPlugin +# Example value: coreModClass = asm.FMLPlugin + modGroup = com.hermanoid.nerd -> com.hermanoid.nerd.asm.FMLPlugin coreModClass = # If your project is only a consolidation of mixins or a core mod and does NOT contain a 'normal' mod ( = some class # that is annotated with @Mod) you want this to be true. When in doubt: leave it on false! diff --git a/src/main/java/com/myname/mymodid/ClientProxy.java b/src/main/java/com/hermanoid/nerd/ClientProxy.java similarity index 88% rename from src/main/java/com/myname/mymodid/ClientProxy.java rename to src/main/java/com/hermanoid/nerd/ClientProxy.java index ea70aa1..238d400 100644 --- a/src/main/java/com/myname/mymodid/ClientProxy.java +++ b/src/main/java/com/hermanoid/nerd/ClientProxy.java @@ -1,4 +1,4 @@ -package com.myname.mymodid; +package com.hermanoid.nerd; public class ClientProxy extends CommonProxy { diff --git a/src/main/java/com/myname/mymodid/CommonProxy.java b/src/main/java/com/hermanoid/nerd/CommonProxy.java similarity index 85% rename from src/main/java/com/myname/mymodid/CommonProxy.java rename to src/main/java/com/hermanoid/nerd/CommonProxy.java index d5df802..7aa35d9 100644 --- a/src/main/java/com/myname/mymodid/CommonProxy.java +++ b/src/main/java/com/hermanoid/nerd/CommonProxy.java @@ -1,4 +1,4 @@ -package com.myname.mymodid; +package com.hermanoid.nerd; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; @@ -12,8 +12,8 @@ public class CommonProxy { public void preInit(FMLPreInitializationEvent event) { Config.synchronizeConfiguration(event.getSuggestedConfigurationFile()); - MyMod.LOG.info(Config.greeting); - MyMod.LOG.info("I am " + Tags.MODNAME + " at version " + Tags.VERSION); + NotEnoughRecipeDumps.LOG.info(Config.greeting); + NotEnoughRecipeDumps.LOG.info("I am " + Tags.MODNAME + " at version " + Tags.VERSION); } // load "Do your mod setup. Build whatever data structures you care about. Register recipes." (Remove if not needed) diff --git a/src/main/java/com/myname/mymodid/Config.java b/src/main/java/com/hermanoid/nerd/Config.java similarity index 94% rename from src/main/java/com/myname/mymodid/Config.java rename to src/main/java/com/hermanoid/nerd/Config.java index b1c4f50..497f764 100644 --- a/src/main/java/com/myname/mymodid/Config.java +++ b/src/main/java/com/hermanoid/nerd/Config.java @@ -1,4 +1,4 @@ -package com.myname.mymodid; +package com.hermanoid.nerd; import java.io.File; diff --git a/src/main/java/com/myname/mymodid/MyMod.java b/src/main/java/com/hermanoid/nerd/NotEnoughRecipeDumps.java similarity index 89% rename from src/main/java/com/myname/mymodid/MyMod.java rename to src/main/java/com/hermanoid/nerd/NotEnoughRecipeDumps.java index 316b563..b12ef57 100644 --- a/src/main/java/com/myname/mymodid/MyMod.java +++ b/src/main/java/com/hermanoid/nerd/NotEnoughRecipeDumps.java @@ -1,4 +1,4 @@ -package com.myname.mymodid; +package com.hermanoid.nerd; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -11,11 +11,11 @@ import cpw.mods.fml.common.event.FMLServerStartingEvent; @Mod(modid = Tags.MODID, version = Tags.VERSION, name = Tags.MODNAME, acceptedMinecraftVersions = "[1.7.10]") -public class MyMod { +public class NotEnoughRecipeDumps { public static final Logger LOG = LogManager.getLogger(Tags.MODID); - @SidedProxy(clientSide = "com.myname.mymodid.ClientProxy", serverSide = "com.myname.mymodid.CommonProxy") + @SidedProxy(clientSide = "com.hermanoid.nerd.ClientProxy", serverSide = "com.hermanoid.nerd.CommonProxy") public static CommonProxy proxy; @Mod.EventHandler