Optimize code

This commit is contained in:
FlorianMichael 2023-12-12 22:16:37 +01:00
parent 736ac43868
commit ecd5d18818
No known key found for this signature in database
GPG Key ID: C2FB87E71C425126

View File

@ -49,15 +49,11 @@ public abstract class AbstractSave {
*/
public void init() {
if (file.exists()) {
JsonObject parentNode = null;
try (final FileReader fr = new FileReader(file)) {
parentNode = GSON.fromJson(fr, JsonObject.class);
read(GSON.fromJson(fr, JsonObject.class));
} catch (Exception e) {
ViaFabricPlus.global().getLogger().error("Failed to read file: " + file.getName() + "!");
}
if (parentNode != null) {
read(parentNode);
}
}
}