Interface HierarchicalConfigManagerFactory
public interface HierarchicalConfigManagerFactory
-
Method Summary
Modifier and TypeMethodDescription<E extends HierarchicalConfig>
HierarchicalConfigManager<E> Create a hierarchical config manager.<E extends HierarchicalConfig>
NamespacedHierarchicalConfigManager<E> createDynamicNamespaced(String domain, E defaultConfig, Iterable<net.minecraft.resources.ResourceLocation> defaultAllowedModuleIds, Callable<Iterable<net.minecraft.resources.ResourceLocation>> getAllowedModuleIds) Create a dynamic namespaced hierarchical config manager.<E extends HierarchicalConfig>
NamespacedHierarchicalConfigManager<E> createNamespaced(String domain, E defaultConfig, Iterable<net.minecraft.resources.ResourceLocation> allowedModuleIds) Create a hierarchical config manager based aroundResourceLocationIDs instead of Strings.
-
Method Details
-
create
<E extends HierarchicalConfig> HierarchicalConfigManager<E> create(String domain, E defaultConfig, Iterable<String> allowedModuleIds) Create a hierarchical config manager. With this, you can have a default/fallback config, and custom defined configs that override it for specific cases.- Parameters:
domain- The config domain, will be used as the folder name the custom configs are created in, and the reloadable group which all of the custom defined configs belong to.defaultConfig- The default config object. You will need to manage the loading, saving, etc of this. I recommend making the default config double as aConfigand registering it withConfigStateManager.allowedModuleIds- The allowed IDs that can be used to override the default config. These are used to scan for which existing overrides can be loaded/reloaded from the config/domain folder.
-
createNamespaced
<E extends HierarchicalConfig> NamespacedHierarchicalConfigManager<E> createNamespaced(String domain, E defaultConfig, Iterable<net.minecraft.resources.ResourceLocation> allowedModuleIds) Create a hierarchical config manager based aroundResourceLocationIDs instead of Strings. Each identifier's domain will have a folder within the config/domain folder.- See Also:
-
createDynamicNamespaced
<E extends HierarchicalConfig> NamespacedHierarchicalConfigManager<E> createDynamicNamespaced(String domain, E defaultConfig, Iterable<net.minecraft.resources.ResourceLocation> defaultAllowedModuleIds, Callable<Iterable<net.minecraft.resources.ResourceLocation>> getAllowedModuleIds) Create a dynamic namespaced hierarchical config manager. It is similar to a standard namespaced config manager, except the domain of allowed module IDs can change after initial creation. UseReloadableManagerwith group "dynamic_(domain)" to notify it that the list of allowed IDs may have changed.- See Also:
-