chore: update jfCommons
This commit is contained in:
parent
01f562339a
commit
e50428aa15
@ -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"
|
||||
|
@ -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();
|
||||
DefaultConfigIO.Action action = actions.get(name);
|
||||
if (action == null) {
|
||||
LibJf.LOGGER.warn("Unrecognized key in config for " + id + ": " + name);
|
||||
reader.skipValue();
|
||||
continue;
|
||||
try (var view = reader.createView()) {
|
||||
DefaultConfigIO.Action action = actions.get(name);
|
||||
if (action == null) {
|
||||
LibJf.LOGGER.warn("Unrecognized key in config for " + id + ": " + name);
|
||||
continue;
|
||||
}
|
||||
if (!appeared.add(name)) {
|
||||
LibJf.LOGGER.warn("Duplicate key in config for " + id + ": " + name);
|
||||
continue;
|
||||
}
|
||||
action.task.accept(view);
|
||||
}
|
||||
if (!appeared.add(name)) {
|
||||
LibJf.LOGGER.warn("Duplicate key in config for " + id + ": " + name);
|
||||
reader.skipValue();
|
||||
continue;
|
||||
}
|
||||
action.task.accept(reader);
|
||||
}
|
||||
reader.endObject();
|
||||
actions.forEach((name, action) -> {
|
||||
|
Loading…
Reference in New Issue
Block a user