Config refactor

This commit is contained in:
Aleksey 2020-12-12 00:49:35 +03:00
parent 58a389eaf2
commit fd06db2822
6 changed files with 134 additions and 183 deletions

View file

@ -8,19 +8,8 @@ import ru.betterend.world.biome.EndBiome;
public class BiomeConfig extends Config {
private final ConfigWriter writer;
private final String group = "biomes";
protected BiomeConfig() {
this.writer = new ConfigWriter(group);
this.settings = writer.load();
this.registerEntries();
if (settings.size() > 0) {
this.configKeeper.fromJson(settings);
} else {
this.configKeeper.toJson(settings);
this.writer.save();
}
super("biomes");
}
@Override
@ -28,7 +17,6 @@ public class BiomeConfig extends Config {
@Override
public void saveChanges() {
this.configKeeper.toJson(settings);
this.writer.saveConfig();
}