MidnightLib
MidnightLib copied to clipboard
If a config file does not contain a list, Minecraft crashes upon an attempt to modify the list
Using MidnightLib 1.4.1-fabric.
To reproduce:
-
Make a config with a string list.
-
Launch the game and open the config screen.
-
Try to insert something into the textbox.
-
Crash due to UnsupportedOperationException.
-
Launch Minecraft, but this time open the config screen and close it (so that the config file generates).
-
Try to insert something into the textbox.
-
Succeed.
Log: 2023-12-01-7.log
Current workaround: Add MidnightConfig.write("modid");
below the MidnightConfig.init("modid", ConfigFile.class)
so that the config file is present and filled.
This seems like an issue on your side.
You need to use an array list instead of a normal one, like this:
public static List<String> listTest = new ArrayList<>();
Alternatively, you can use Lists.newArrayList();