Package com.binaris.wizardry.core.config
Class ConfigManager
java.lang.Object
com.binaris.wizardry.core.config.ConfigManager
-
Method Summary
Modifier and TypeMethodDescriptionstatic ArrayList<ConfigProvider>static voidload(ConfigProvider provider) Load a config provider, checking if it's registered and creating the file if it doesn't exist, loading the file otherwisestatic voidloadFile(ConfigProvider provider) Load a config provider from a file, checking if it's registered and loading the filestatic voidloadServerConfigs(Path worldPath) Load all server configs, setting the server config path and loading all server configsstatic voidstatic voidregister(ConfigProvider provider) Register a config provider, by default it will load automatically it's file and properties (in case if isn't server config)static voidregister(ConfigProvider provider, boolean load) Register a config provider, it will load automatically it's file and properties (in case if isn't server config) if load is truestatic voidRestores the local configuration values for common and server configs, used when client is disconnected (by any reason) from the server and we need to reset the server configs to default.static voidsave(ConfigProvider configProvider) Save a config provider, checking if it's registered and saving the file
-
Method Details
-
register
Register a config provider, by default it will load automatically it's file and properties (in case if isn't server config)- Parameters:
provider- The config provider to register
-
register
Register a config provider, it will load automatically it's file and properties (in case if isn't server config) if load is true- Parameters:
provider- The config provider to registerload- Whether to load the config provider automatically
-
load
Load a config provider, checking if it's registered and creating the file if it doesn't exist, loading the file otherwise- Parameters:
provider- The config provider to load
-
loadServerConfigs
Load all server configs, setting the server config path and loading all server configs- Parameters:
worldPath- The path to the world
-
save
Save a config provider, checking if it's registered and saving the file- Parameters:
configProvider- The config provider to save
-
loadFile
Load a config provider from a file, checking if it's registered and loading the file- Parameters:
provider- The config provider to load
-
onPlayerJoin
-
restoreLocalConfigs
public static void restoreLocalConfigs()Restores the local configuration values for common and server configs, used when client is disconnected (by any reason) from the server and we need to reset the server configs to default. -
getConfigProviders
-