chore: update jfCommons

This commit is contained in:
Johannes Frohnmeyer 2024-06-09 13:35:57 +02:00
parent 01f562339a
commit e50428aa15
Signed by: Johannes
GPG Key ID: E76429612C2929F4
2 changed files with 12 additions and 13 deletions

View File

@ -4,7 +4,7 @@ minecraft = "1.21-pre4"
yarn = "build.3"
fabric-loader = "0.15.11"
fabric-api = "0.100.0+1.21"
jf-commons = "1.7-SNAPSHOT"
jf-commons = "2.0.0-SNAPSHOT"
modmenu = "11.0.0-beta.1"
annotations = "24.1.0"
javapoet = "1.13.0"

View File

@ -43,23 +43,22 @@ public class DefaultConfigIO {
reader.skipValue();
return;
}
//TODO take advantage of commons-serialize's single-item view to permit illegal entries without messing up the rest
Set<String> appeared = new HashSet<>();
reader.beginObject();
while (reader.peek() != Token.END_OBJECT) {
String name = reader.nextName();
try (var view = reader.createView()) {
DefaultConfigIO.Action action = actions.get(name);
if (action == null) {
LibJf.LOGGER.warn("Unrecognized key in config for " + id + ": " + name);
reader.skipValue();
continue;
}
if (!appeared.add(name)) {
LibJf.LOGGER.warn("Duplicate key in config for " + id + ": " + name);
reader.skipValue();
continue;
}
action.task.accept(reader);
action.task.accept(view);
}
}
reader.endObject();
actions.forEach((name, action) -> {