As far as I can tell you can't have missing values in your config structure or at least the possibility of an empty array.
example:
public class TestConfig extends Config {
public TestConfig() {
super(of(Test), File, "Test");
}
public static TestGroup Test = new TestGroup("test");
public static class TestGroup extends ConfigItemGroup {
public TestGroup(String name) {
super(of(Array), name);
}
public static ArrayConfigItem<Integer> Array = new ArrayConfigItem<>("arr",new Integer[]{}, "");
}
}
This will throw an error: Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0
otherwise you have to give it a value, this value is then populated in the json.
public static ArrayConfigItem<Integer> Array = new ArrayConfigItem<>("arr",new Integer[]{1}, "");
```json
{
"test": {
"arr": [
1
]
}
}
in this example there is no way to make "arr" an empty array. It would be nice to at least be able to have empty arrays even if nullable properties wouldn't be possible.
As far as I can tell you can't have missing values in your config structure or at least the possibility of an empty array.
example:
This will throw an error: Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0
otherwise you have to give it a value, this value is then populated in the json.
in this example there is no way to make
"arr"an empty array. It would be nice to at least be able to have empty arrays even if nullable properties wouldn't be possible.