A little more Config refactor
This commit is contained in:
parent
c2d6a30499
commit
f50311f0e2
3 changed files with 4 additions and 11 deletions
|
@ -14,11 +14,6 @@ public class BiomeConfig extends Config {
|
||||||
@Override
|
@Override
|
||||||
protected void registerEntries() {}
|
protected void registerEntries() {}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void saveChanges() {
|
|
||||||
this.writer.saveConfig();
|
|
||||||
}
|
|
||||||
|
|
||||||
private ConfigKey createKey(Identifier biome, String key) {
|
private ConfigKey createKey(Identifier biome, String key) {
|
||||||
Identifier groupId = new Identifier(group, biome.getNamespace());
|
Identifier groupId = new Identifier(group, biome.getNamespace());
|
||||||
Identifier categoryId = new Identifier(biome.getPath(), key);
|
Identifier categoryId = new Identifier(biome.getPath(), key);
|
||||||
|
|
|
@ -18,7 +18,6 @@ public abstract class Config {
|
||||||
protected final ConfigWriter writer;
|
protected final ConfigWriter writer;
|
||||||
protected final String group;
|
protected final String group;
|
||||||
|
|
||||||
public abstract void saveChanges();
|
|
||||||
protected abstract void registerEntries();
|
protected abstract void registerEntries();
|
||||||
|
|
||||||
public Config(String group) {
|
public Config(String group) {
|
||||||
|
@ -30,6 +29,10 @@ public abstract class Config {
|
||||||
this.writer.save();
|
this.writer.save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void saveChanges() {
|
||||||
|
this.writer.saveConfig();
|
||||||
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
public <E extends Entry<?>> E getEntry(ConfigKey key) {
|
public <E extends Entry<?>> E getEntry(ConfigKey key) {
|
||||||
return this.configKeeper.getEntry(key);
|
return this.configKeeper.getEntry(key);
|
||||||
|
|
|
@ -14,11 +14,6 @@ public class ItemConfig extends Config {
|
||||||
@Override
|
@Override
|
||||||
protected void registerEntries() {}
|
protected void registerEntries() {}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void saveChanges() {
|
|
||||||
this.writer.save();
|
|
||||||
}
|
|
||||||
|
|
||||||
private ConfigKey createKey(Identifier item, String category) {
|
private ConfigKey createKey(Identifier item, String category) {
|
||||||
Identifier groupId = new Identifier(group, item.getNamespace());
|
Identifier groupId = new Identifier(group, item.getNamespace());
|
||||||
Identifier categoryId = new Identifier(category, item.getPath());
|
Identifier categoryId = new Identifier(category, item.getPath());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue