Carbon-Config-Project / CarbonConfig

Apache License 2.0
3 stars 2 forks source link

Blocks from Et Futurum Requiem seem to get disabled during the Startup Phase when Carbon Config is installed. #11

Closed GregoriusT closed 10 months ago

GregoriusT commented 10 months ago

Blocks from Et Futurum Requiem seem to get disabled during the Startup Phase when Carbon Config is installed.

This happens to randomly interact with the check of GregTech-6 if EFR is up to date, to crash on startup as the EFR Stone Block should never be disabled in its Config when GT6 is installed. (which might be considered bad design on my end, but that can of worms is offtopic for the purposes of this Issue, LOL)

Also might need help from @Roadhog360 to find what the heck the Issue is.

there you go Speiger.

Roadhog360 commented 10 months ago

Are they mixing into, or making any changes to the vanilla Forge config system?

My configs are populated during the mixin init phase; some of these need to be populated as early as possible, if that helps narrow down the cause.

Speiger commented 10 months ago

@Roadhog360 we hook into Forges Config file during its creation. https://github.com/Carbon-Config-Project/CarbonConfig/blob/33befbabc2aa3cafd3a3c0224a67d74c0ed81113/src/main/java/carbonconfiglib/impl/internal/CarbonConfigHooks.java#L83

Which results into this: https://github.com/Carbon-Config-Project/CarbonConfig/blob/33befbabc2aa3cafd3a3c0224a67d74c0ed81113/src/main/java/carbonconfiglib/impl/internal/EventHandler.java#L81

Since there is no global Config Tracker in Forge 1.7.10-1.12.2 But we also expect that a Mod is being set in the Loader.instance().activeModContainer() If it is not set then it will simply discard it.

But it will NOT mess with the configs. it will simply scan them and when you open the gui.

So any Mixin Config should be ignored by us, unless you set the active modContainer.

But i will do now some investigation too.

Meduris commented 10 months ago

just some additional notes about that asm hook:

we inject that into the net.minecraftforge.common.config.Configuration constructor that takes a File and a String and inject that right at the end of that method.

Speiger commented 10 months ago

@Roadhog360 @GregoriusT yeah Et Futurum Requiem was basically crashing because FMLCommonHandler wasn't loaded. And I tested against that for server configs.

That is now fixed on my side, i will be releasing the next patch.

I also just added support for extra early configs. Though it will require a IMC message from the mod who wants the support.

@Roadhog360 Basically, if you want to support the gui, Simply send a IMC message towards carbon config with the key "registerGui" and the absolute path of the config (basically: configuration.getConfigFile().getAbsolutePath)

Sorry for the inconvenience.

have a nice day!

Speiger commented 10 months ago

Fixed release