Closed TelepathicGrunt closed 2 months ago
I managed to make an early loading config back in 1.16.5 with minimal effort for the sake of configuring registry subs. It was just enough effort that people won't do it without having a good reason but its not so much effort its impossible. Not sure Forge needs something fancier
Another dev found a cleaner way to load configs earlier. Don’t use my workaround as that’s ugly.
(Be sure to add .sync to the builder for synchronous writes)
This would be very nice to have as an opt in. I've seen many instances of people trying to do this and causing all other mod configs to load early causing all sorts of issues
Closed in 39aa9f216cada1e477960669ec36833aebd94902.
Long story short, there's use cases beyond the frowned-upon conditional registration that modders need to have early configs for.
Myself, I had use cases where I was using EntityAttributeModificationEvent to modify another mod's entity's health and attack damage. And I wanted those values to be configurable. But I needed to load the config early to actually make it work.
Another use case I had was I had an entity that uses vanilla's model but with my own renderer that extends the vanilla renderer. So that my entity would inherit any modification that other mods do to the vanilla entity model such as adding hat models for bees or whatnot. This breaks with model changing resourcepacks that change the entire model. So I am using a config to allow users to have my entity use it's own hard copy/paste model/renderer but to register the model/renderer (specifically the model mesh), I need the config loaded early.
This si what I am currently doing. Not great and ugly if many mods does it.![image](https://github.com/neoforged/NeoForge/assets/40846040/5c273790-f7b8-43ce-98b4-7288dd15bf5a)
A built in way to specify that a mod's config should be loaded early as an opt-in thing would be ideal. For people that know what they are doing. Neoforge currently throws in dev when accessing config too early. But if a modder is determined, this throw won't stop them from forcing the config to load or rolling out their own config.