Open Epic428 opened 4 years ago
I don't have such lists ready until late preinit, and they are used for ore dictionary-driven recipe generation in GTCE primarily. I don't see methods like that needed because they are very specialised. While I can give you these lists (but beware they're not complete at the stage CT runs in), I suggest using more standardized approach used in GTCE: ore dictionary processing handlers, which will be called in special stage to generate recipes. Example case:
OrePrefix.get("plate").registerProcessingHandler(function(prefix, material, itemStack) {
//Do something with material/item stack there
});
Is OrePrefix something I can use in crafttweaker? This is my first time playing around with it so still learning.
The sample script I posted above is the script I’m currently using and with subsequent recipes it hasn’t been terribly difficult to replicate it since at this point I have about 60 materials hardcoded into an array. My goal is to make the scripts more optimized but allow for any possible changes in materials or oredict entries down the line without needing to be rewritten.
I’m ok with a different approach to accomplishing the goal if such suggestions aren’t feasible or don’t make sense.
Edit: ok looking at the docs for crafttweaker again I see where I can get an IOreDictEntry with a given prefix. So that’s useful. I’ll keep looking to see how I can improve this further.
Reading further if I could pull a master list of ores then get the ore entries from there maybe I could make this work differently.
I'd like to propose new CT Getters to get specific arrays of data on Ore Dictionary entries and Material Lists. Specifically, looking for arrays which would contain a list of all plate OreDict entries, stick entries, screw, gear etc. Additionally looking for arrays which would provide lists of all materials used for tools.
Take for example the CT script below. It only modifies recipes for about half of the possible wire cutter varieties so they can be crafted in an artisan workbench. However, if I extrapolate the data to include all Hammer, File, Drill, Screwdriver, etc. varieties the amount of hard coded data necessary begins to pile up.
Being able to call a method which returns and array of oreDict entries for various components and materials would make this much more efficient and easier to handle.
so for example you could have a variable, ,...]
oreDictEntry
that calls a method ofgetPlates()
and returns an array containing all plate oreDict entries like so `[same thing would work for Materials - being able to get a list of materials which are all fluids, or all dusts, or ingots, or usable for tools, etc.
I'm not sure, off the top of my head what other use cases these getters would have beyond being able to modify large amounts of tool recipes but it is possible they could be useful elsewhere as well.