Bug Description
The game crashes during initialization with a NullPointerException coming from MidnightConfig.writeChanges(String). This occurs when PackRepository.setSelected calls the Visual Overhaul mixin (handler$dpe000$visualoverhaul$setDefaultEnabledPacks).
It seems like Visual Overhaul is attempting to write to the config before MidnightLib has fully registered the mod's configuration map, resulting in a null lookup.
Steps to Reproduce
- Install Visual Overhaul for NeoForge 1.21.1.
- Install MidnightLib (version 1.9.3+1.21.1).
- Launch Minecraft.
- The game crashes on the "Initializing game" stage.
Environment
- Minecraft Version: 1.21.1
- Mod Loader: NeoForge (Loader version 4.0.42 / Modlauncher 11.0.5)
- MidnightLib Version: 1.9.3+1.21.1
- Visual Overhaul Version: Latest available for 1.21.1 NeoForge
Additional Context
- Deleting the configuration files for Visual Overhaul did not resolve the issue.
- The crash happens on the Render Thread during game setup.
Crash Report
java.lang.NullPointerException: Cannot invoke "eu.midnightdust.lib.config.MidnightConfig.writeChanges(String)" because the return value of "java.util.Map.get(Object)" is null
at TRANSFORMER/midnightlib@1.9.3/eu.midnightdust.lib.config.MidnightConfig.write(MidnightConfig.java:241)
at TRANSFORMER/minecraft@1.21.1/net.minecraft.server.packs.repository.PackRepository.handler$dpe000$visualoverhaul$setDefaultEnabledPacks(PackRepository.java:530)
at TRANSFORMER/minecraft@1.21.1/net.minecraft.server.packs.repository.PackRepository.setSelected(PackRepository.java:56)
at TRANSFORMER/minecraft@1.21.1/net.minecraft.client.Options.loadSelectedResourcePacks(Options.java:1554)
at TRANSFORMER/minecraft@1.21.1/net.minecraft.client.Minecraft.<init>(Minecraft.java:488)
at TRANSFORMER/minecraft@1.21.1/net.minecraft.client.main.Main.main(Main.java:214)```
Bug Description
The game crashes during initialization with a
NullPointerExceptioncoming fromMidnightConfig.writeChanges(String). This occurs whenPackRepository.setSelectedcalls the Visual Overhaul mixin (handler$dpe000$visualoverhaul$setDefaultEnabledPacks).It seems like Visual Overhaul is attempting to write to the config before MidnightLib has fully registered the mod's configuration map, resulting in a null lookup.
Steps to Reproduce
Environment
Additional Context
Crash Report