chore: update jfCommons
This commit is contained in:
parent
01f562339a
commit
e50428aa15
@ -4,7 +4,7 @@ minecraft = "1.21-pre4"
|
|||||||
yarn = "build.3"
|
yarn = "build.3"
|
||||||
fabric-loader = "0.15.11"
|
fabric-loader = "0.15.11"
|
||||||
fabric-api = "0.100.0+1.21"
|
fabric-api = "0.100.0+1.21"
|
||||||
jf-commons = "1.7-SNAPSHOT"
|
jf-commons = "2.0.0-SNAPSHOT"
|
||||||
modmenu = "11.0.0-beta.1"
|
modmenu = "11.0.0-beta.1"
|
||||||
annotations = "24.1.0"
|
annotations = "24.1.0"
|
||||||
javapoet = "1.13.0"
|
javapoet = "1.13.0"
|
||||||
|
@ -43,23 +43,22 @@ public class DefaultConfigIO {
|
|||||||
reader.skipValue();
|
reader.skipValue();
|
||||||
return;
|
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<>();
|
Set<String> appeared = new HashSet<>();
|
||||||
reader.beginObject();
|
reader.beginObject();
|
||||||
while (reader.peek() != Token.END_OBJECT) {
|
while (reader.peek() != Token.END_OBJECT) {
|
||||||
String name = reader.nextName();
|
String name = reader.nextName();
|
||||||
|
try (var view = reader.createView()) {
|
||||||
DefaultConfigIO.Action action = actions.get(name);
|
DefaultConfigIO.Action action = actions.get(name);
|
||||||
if (action == null) {
|
if (action == null) {
|
||||||
LibJf.LOGGER.warn("Unrecognized key in config for " + id + ": " + name);
|
LibJf.LOGGER.warn("Unrecognized key in config for " + id + ": " + name);
|
||||||
reader.skipValue();
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (!appeared.add(name)) {
|
if (!appeared.add(name)) {
|
||||||
LibJf.LOGGER.warn("Duplicate key in config for " + id + ": " + name);
|
LibJf.LOGGER.warn("Duplicate key in config for " + id + ": " + name);
|
||||||
reader.skipValue();
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
action.task.accept(reader);
|
action.task.accept(view);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
reader.endObject();
|
reader.endObject();
|
||||||
actions.forEach((name, action) -> {
|
actions.forEach((name, action) -> {
|
||||||
|
Loading…
Reference in New Issue
Block a user