More config refactor

This commit is contained in:
Aleksey 2020-12-12 19:14:25 +03:00
parent c630e6d22a
commit 74e9adf42e
7 changed files with 96 additions and 133 deletions

View file

@ -1,9 +1,15 @@
package ru.betterend.config;
public class Configs {
public static final IdentifierConfig ITEM_CONFIG = new IdentifierConfig("items");
public static final IdentifierConfig BLOCK_CONFIG = new IdentifierConfig("blocks");
public static final IdentifierConfig BIOME_CONFIG = new IdentifierConfig("biomes");
public static final IdConfig ITEM_CONFIG = new IdConfig("items", (item, category) -> {
return new ConfigKey(item.getNamespace(), category, item.getPath());
});
public static final IdConfig BLOCK_CONFIG = new IdConfig("blocks", (block, category) -> {
return new ConfigKey(block.getNamespace(), category, block.getPath());
});
public static final IdConfig BIOME_CONFIG = new IdConfig("biomes", (biome, entry) -> {
return new ConfigKey(biome.getNamespace(), biome.getPath(), entry);
});
public static void saveConfigs() {
ITEM_CONFIG.saveChanges();