CraftTweaker

CraftTweaker

151M Downloads

Option to dump to separate json files

Syndaryl opened this issue ยท 3 comments

commented

Feature request name
Option to dump to separate json files

Feature request description
I would like an option to produce each of the dumps to an external file in some sort of standardized markup format (json seems popular with MC but whatever). Ideally I would like an option to dump all the different kinds in one swell foop. This could be dumping to a single monolithic file with a separate section per kind, or to one file per kind of dump (recipes.json, names.json, etc).

Feature request reason
I have too many food mods, and I am trying to re-balance food recipes for my internal server economy (both targeting the food restore values, and also the food "cash" value in the trade system). I want the food restore values to be proportionate to the number of ingredients and number of crafting steps required to create, similarly I want the vendor prices to be related to same. Basic ingredient vendor prices will likely need to be adjusted depending on how many crafting trees they're involved in.
This requires going over every recipe for each food item, resolving each oredict reference to create a "tree" of ingredients required to create it and (in this case) finding the shortest path of the tree to find the simplest way to craft the item.
This is a lot of stuff, so I'm writing a program to do it. I anticipate having to rebalance everything repeatedly as mods update, so this makes the program doubly important. The work I'm doing will likely also be valuable for non-food ingredients, and Pam from Pam's Harvestcraft has expressed an interest in my data in order to continue balancing the food from her own mod.

Using a regular format in an external file would greatly help, as the data dumps are currently mixed in with the log info, and each dump type further seems to feature its own formatting.

Feature request dependencies
This would require a code change in CraftTweaker, of course.
A rough workflow I'm anticipating is that there would be a new CT command (for example: /ct dump_jsons) - one might specify the dump types as a space or comma separated list, and "all" as a shortcut for everything, or it might just dump all. I'm satisfied with "all" myself.
After dumping CraftTweaker would present a link to the file, as usual.

commented

there is already a /ct dumpzs json (in 1.12, which I assume you are using) are you asking for something else or?

commented

I guess I'm essentially looking for a parallel to the dumpZs command.
In this case I'm specifically interested in
[ ] all items ("Names" with all the category options by default, as a "simple" default)
[ ] all OreDict entries
[ ] all crafting table recipes
[ ] all furnace recipes

I have a draft setup working right now with this dump information that I have manually reformatted, as a proof of concept. Manually reformatting all the data (rather than the subuset I've done for testing purposes) would drive me nuts.

I read in all the item objects and deserialize them into a native object type and put them in a collection.
I read in the ore dictionary and replace the ore dict members with actual references to the Item objects.
I read in all the recipe objects and deserialize them also, using the Oredict to create a tree structure to resolve down to uncraftable items.

It works conceptually, but the data entry part is daunting.

commented

No reply in over a year, if this is still an issue please reopen / make a new issue.