mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-10-26 05:50:08 +00:00
move meta registration to separate method
This commit is contained in:
1 parent
6c69e3fad1
commit
4dcd013db4
1 file changed
+23
-19
+23
-19
@@ -184,25 +184,7 @@ public class ConfigPackImpl implements ConfigPack {
|
|||||||
|
|
||||||
platform.getEventManager().callEvent(new ConfigurationDiscoveryEvent(this, loader, (s, c) -> configurations.put(s.replace("\\","/"), c))); // Create all the configs.
|
platform.getEventManager().callEvent(new ConfigurationDiscoveryEvent(this, loader, (s, c) -> configurations.put(s.replace("\\","/"), c))); // Create all the configs.
|
||||||
|
|
||||||
MetaStringPreprocessor stringPreprocessor = new MetaStringPreprocessor(configurations);
|
registerMeta(configurations);
|
||||||
selfLoader.registerPreprocessor(Meta.class, stringPreprocessor);
|
|
||||||
abstractConfigLoader.registerPreprocessor(Meta.class, stringPreprocessor);
|
|
||||||
|
|
||||||
MetaListLikePreprocessor listPreprocessor = new MetaListLikePreprocessor(configurations);
|
|
||||||
selfLoader.registerPreprocessor(Meta.class, listPreprocessor);
|
|
||||||
abstractConfigLoader.registerPreprocessor(Meta.class, listPreprocessor);
|
|
||||||
|
|
||||||
MetaMapPreprocessor mapPreprocessor = new MetaMapPreprocessor(configurations);
|
|
||||||
selfLoader.registerPreprocessor(Meta.class, mapPreprocessor);
|
|
||||||
abstractConfigLoader.registerPreprocessor(Meta.class, mapPreprocessor);
|
|
||||||
|
|
||||||
MetaValuePreprocessor valuePreprocessor = new MetaValuePreprocessor(configurations);
|
|
||||||
selfLoader.registerPreprocessor(Meta.class, valuePreprocessor);
|
|
||||||
abstractConfigLoader.registerPreprocessor(Meta.class, valuePreprocessor);
|
|
||||||
|
|
||||||
MetaNumberPreprocessor numberPreprocessor = new MetaNumberPreprocessor(configurations);
|
|
||||||
selfLoader.registerPreprocessor(Meta.class, numberPreprocessor);
|
|
||||||
abstractConfigLoader.registerPreprocessor(Meta.class, numberPreprocessor);
|
|
||||||
|
|
||||||
Map<ConfigType<? extends ConfigTemplate, ?>, List<Configuration>> configs = new HashMap<>();
|
Map<ConfigType<? extends ConfigTemplate, ?>, List<Configuration>> configs = new HashMap<>();
|
||||||
|
|
||||||
@@ -243,6 +225,28 @@ public class ConfigPackImpl implements ConfigPack {
|
|||||||
checkDeadEntries();
|
checkDeadEntries();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void registerMeta(Map<String, Configuration> configurations) {
|
||||||
|
MetaStringPreprocessor stringPreprocessor = new MetaStringPreprocessor(configurations);
|
||||||
|
selfLoader.registerPreprocessor(Meta.class, stringPreprocessor);
|
||||||
|
abstractConfigLoader.registerPreprocessor(Meta.class, stringPreprocessor);
|
||||||
|
|
||||||
|
MetaListLikePreprocessor listPreprocessor = new MetaListLikePreprocessor(configurations);
|
||||||
|
selfLoader.registerPreprocessor(Meta.class, listPreprocessor);
|
||||||
|
abstractConfigLoader.registerPreprocessor(Meta.class, listPreprocessor);
|
||||||
|
|
||||||
|
MetaMapPreprocessor mapPreprocessor = new MetaMapPreprocessor(configurations);
|
||||||
|
selfLoader.registerPreprocessor(Meta.class, mapPreprocessor);
|
||||||
|
abstractConfigLoader.registerPreprocessor(Meta.class, mapPreprocessor);
|
||||||
|
|
||||||
|
MetaValuePreprocessor valuePreprocessor = new MetaValuePreprocessor(configurations);
|
||||||
|
selfLoader.registerPreprocessor(Meta.class, valuePreprocessor);
|
||||||
|
abstractConfigLoader.registerPreprocessor(Meta.class, valuePreprocessor);
|
||||||
|
|
||||||
|
MetaNumberPreprocessor numberPreprocessor = new MetaNumberPreprocessor(configurations);
|
||||||
|
selfLoader.registerPreprocessor(Meta.class, numberPreprocessor);
|
||||||
|
abstractConfigLoader.registerPreprocessor(Meta.class, numberPreprocessor);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public <T> ConfigPackImpl applyLoader(Type type, TypeLoader<T> loader) {
|
public <T> ConfigPackImpl applyLoader(Type type, TypeLoader<T> loader) {
|
||||||
abstractConfigLoader.registerLoader(type, loader);
|
abstractConfigLoader.registerLoader(type, loader);
|
||||||
|
|||||||
Reference in new issue
Block a user