Summary
simulated_cc_compat reads a config value during mod construction, before NeoForge has loaded the config. This throws IllegalStateException: Cannot get config value before config is loaded, which fails construction of Create Simulated (simulated) and aborts mod loading. It reproduces inconsistently and appears to be timing/hardware dependent (see note below).
Environment
- Minecraft: 1.21.1
- NeoForge: 21.1.247
simulated_cc_compat: 1.1.2
- Create Simulated (
simulated): 1.3.0
- Create: Avionics (
create_avionics): 0.5.2
What happens
During mod construction, ComputerCraftPeripherals.init() calls ModConfigSpec.BooleanValue#isTrue() before the config spec has been loaded, and NeoForge throws:
java.lang.IllegalStateException: Cannot get config value before config is loaded.
at com.google.common.base.Preconditions.checkState(Preconditions.java:512)
at net.neoforged.neoforge.common.ModConfigSpec$ConfigValue.getRaw(ModConfigSpec.java:1235)
at net.neoforged.neoforge.common.ModConfigSpec$ConfigValue.get(ModConfigSpec.java:1222)
at net.neoforged.neoforge.common.ModConfigSpec$BooleanValue.getAsBoolean(ModConfigSpec.java:1291)
at net.neoforged.neoforge.common.ModConfigSpec$BooleanValue.isTrue(ModConfigSpec.java:1295)
at com.winexp.simulated_cc_compat.content.peripherals.ComputerCraftPeripherals.init(ComputerCraftPeripherals.java:21)
at dev.simulated_team.simulated.service.SimModCompatibilityService.initLoaded(SimModCompatibilityService.java:34)
at dev.simulated_team.simulated.Simulated.init(Simulated.java:56)
at dev.simulated_team.simulated.neoforge.SimulatedNeoForge.<init>(SimulatedNeoForge.java:52)
This causes NeoForge to report Failed to create mod instance. ModID: simulated, followed by FATAL ... Failed to wait for future Mod Construction, 1 errors found. Mod loading then aborts, and the game later crashes downstream with an unrelated-looking "Sodium's config could not be found" error during the loading overlay.
Root cause
ComputerCraftPeripherals.init() at line 21 reads a config value from the mod constructor / construction phase. On NeoForge, config specs are not guaranteed to be loaded at construction time — the read needs to happen later (e.g. in FMLCommonSetupEvent or once configs are confirmed loaded), or be guarded against the config not yet being available.
Timing / reproducibility note
This does not reproduce on all machines. On faster hardware the config finishes loading before construction reaches the offending line, so the read succeeds and the game boots normally. On slower hardware construction reaches the read first and it throws. Two players running a byte-identical mod set saw different results. One booted fine, one crashed every time, which is consistent with a construction-time config read racing against config loading.
Additional context
With Create: Avionics present, the log shows Avionics already suppressing Create Simulated's peripheral init and registering the Simulated peripheral set itself:
[Create: Avionics]: Suppressed Create: Simulated's ComputerCraftPeripherals.init(); Avionics registers the Simulated peripheral set instead
Despite this, simulated_cc_compat's own ComputerCraftPeripherals.init() still runs and throws. It may be worth checking whether this addon should defer to Avionics (or skip its own init) when Avionics is installed, in addition to fixing the config-read timing.
Workaround
Removing simulated_cc_compat-1.1.2.jar avoids the crash; some ComputerCraft peripheral integration still appears to be provided by Create: Avionics in that setup.
Summary
simulated_cc_compatreads a config value during mod construction, before NeoForge has loaded the config. This throwsIllegalStateException: Cannot get config value before config is loaded, which fails construction of Create Simulated (simulated) and aborts mod loading. It reproduces inconsistently and appears to be timing/hardware dependent (see note below).Environment
simulated_cc_compat: 1.1.2simulated): 1.3.0create_avionics): 0.5.2What happens
During mod construction,
ComputerCraftPeripherals.init()callsModConfigSpec.BooleanValue#isTrue()before the config spec has been loaded, and NeoForge throws:This causes NeoForge to report
Failed to create mod instance. ModID: simulated, followed byFATAL ... Failed to wait for future Mod Construction, 1 errors found. Mod loading then aborts, and the game later crashes downstream with an unrelated-looking "Sodium's config could not be found" error during the loading overlay.Root cause
ComputerCraftPeripherals.init()at line 21 reads a config value from the mod constructor / construction phase. On NeoForge, config specs are not guaranteed to be loaded at construction time — the read needs to happen later (e.g. inFMLCommonSetupEventor once configs are confirmed loaded), or be guarded against the config not yet being available.Timing / reproducibility note
This does not reproduce on all machines. On faster hardware the config finishes loading before construction reaches the offending line, so the read succeeds and the game boots normally. On slower hardware construction reaches the read first and it throws. Two players running a byte-identical mod set saw different results. One booted fine, one crashed every time, which is consistent with a construction-time config read racing against config loading.
Additional context
With Create: Avionics present, the log shows Avionics already suppressing Create Simulated's peripheral init and registering the Simulated peripheral set itself:
Despite this,
simulated_cc_compat's ownComputerCraftPeripherals.init()still runs and throws. It may be worth checking whether this addon should defer to Avionics (or skip its own init) when Avionics is installed, in addition to fixing the config-read timing.Workaround
Removing
simulated_cc_compat-1.1.2.jaravoids the crash; some ComputerCraft peripheral integration still appears to be provided by Create: Avionics in that setup.