legobmw99 / Allomancy

Brandon Sanderson's Allomancy, now in Minecraft
https://minecraft.curseforge.com/projects/allomancy
GNU General Public License v3.0
23 stars 18 forks source link

Enhancement suggestion: configurable whitelist/blacklist for active metal reg #82

Closed SpeedyZ500 closed 5 months ago

SpeedyZ500 commented 1 year ago

So I was looking hat how you auto detect the metal list (private static final Pattern ACTIVE_METALREGEX = Pattern.compile( ".*(iron|steel|tin|pewter|zinc|brass|copper|bronze|duralumin|chromium|nicrosil|gold|electrum|cadmium|bendalloy|lead_|silver|platinum|nickle).*");), and I was wondering if you would be able to add a config option in the alloymacy Minecraft configs that would allow you to add metal names to the active metal regex, and if you could also create a metal name blacklist, as there are some metals that I would consider heavily infused in some mods (I.e. soulsteel, or manasteel), but science their names contain steel, are added to the metals config, this also would make it easier to add more metals to the config, it would of course mean that your pattern could not be a final, and may require a different data structure, or some fancy uses of code somewhere else, but from my understanding it should be possible, though it would likely mean that load times would increase, but not as much as say, adding code that somehow screens all recipes to determine if an item contains metal somewhere in its crafting tree

legobmw99 commented 1 year ago

This regex is only used to generate the default whitelist, so it's a bit of a hack. That said, it seems like the things you're requesting are probably easy to manually edit the list in the config?

SpeedyZ500 commented 1 year ago

What my suggestion is proposing is to edit the default world whitelist, manually editing the whitelist works to an extent, but when you have a mod pack that adds say a 10,000 new ores alloys and items, then you would greatly benefit from a modifiable world default whitelist, as well as a world default blacklist, so yes technically it is easy to edit the generated whitelist, but in practice it takes time and becomes tedious, especially with tinkers construct and similar mods, and their compatibility add-ons, and then it would also be nice to blacklist material that are more magical, which some may consider infused, of course, I will probably just do it manually, because I’m on 1.18.2 to play with tinkers construct, as they haven’t migrated to 1.19

SpeedyZ500 commented 1 year ago

If you were asking if it would be easy to edit the regex list in the config, the answer to that would be maybe, it depends on how the data structure is setup to work

SpeedyZ500 commented 1 year ago

And I did look at the code, I understand that it is designed to go through and look at all the items that have the metal names in the item name, which is how you end up with being able to push off of iron wood trees or steel leaf trees in mods like biomes o plenty or the twilight forest

legobmw99 commented 5 months ago

I think this is not something I'd like to support