refactor: Remove use of deprecated JsonParser (turns out I missed on in the update)

This commit is contained in:
Ash (ashisbored) 2021-12-12 16:57:24 +00:00
parent cdb91ea0e4
commit c860c116b6
No known key found for this signature in database
GPG key ID: 1AE71DC3E127235F

View file

@ -76,8 +76,7 @@ public class Config {
} else { } else {
try { try {
String s = Files.readString(path); String s = Files.readString(path);
JsonParser parser = new JsonParser(); JsonElement ele = JsonParser.parseString(s);
JsonElement ele = parser.parse(s);
DataResult<Config> result = CODEC.decode(JsonOps.INSTANCE, ele).map(Pair::getFirst); DataResult<Config> result = CODEC.decode(JsonOps.INSTANCE, ele).map(Pair::getFirst);
Optional<DataResult.PartialResult<Config>> err = result.error(); Optional<DataResult.PartialResult<Config>> err = result.error();
err.ifPresent(e -> PlayerPronouns.LOGGER.warn("Failed to load config: {}", e.message())); err.ifPresent(e -> PlayerPronouns.LOGGER.warn("Failed to load config: {}", e.message()));