TeamMidnightDust / MidnightLib

Common Library for Team MidnightDust's mods. Provides a config api, common utils, and cosmetics.
https://midnightdust.eu/midnightlib
MIT License
31 stars 15 forks source link

If a config file does not contain a list, Minecraft crashes upon an attempt to modify the list #46

Open KonSola5 opened 7 months ago

KonSola5 commented 7 months ago

Using MidnightLib 1.4.1-fabric.

To reproduce:

  1. Make a config with a string list.

  2. Launch the game and open the config screen.

  3. Try to insert something into the textbox.

  4. Crash due to UnsupportedOperationException.

  5. Launch Minecraft, but this time open the config screen and close it (so that the config file generates).

  6. Try to insert something into the textbox.

  7. Succeed.

Log: 2023-12-01-7.log

KonSola5 commented 7 months ago

Current workaround: Add MidnightConfig.write("modid"); below the MidnightConfig.init("modid", ConfigFile.class) so that the config file is present and filled.