Class ConfigManager

java.lang.Object
com.binaris.wizardry.core.config.ConfigManager

public final class ConfigManager extends Object
  • Method Summary

    Modifier and Type
    Method
    Description
     
    static void
    load(ConfigProvider provider)
    Load a config provider, checking if it's registered and creating the file if it doesn't exist, loading the file otherwise
    static void
    Load a config provider from a file, checking if it's registered and loading the file
    static void
    Load all server configs, setting the server config path and loading all server configs
    static void
     
    static void
    Register a config provider, by default it will load automatically it's file and properties (in case if isn't server config)
    static void
    register(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 true
    static void
    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.
    static void
    save(ConfigProvider configProvider)
    Save a config provider, checking if it's registered and saving the file

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • register

      public static void register(ConfigProvider provider)
      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

      public static void register(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 true
      Parameters:
      provider - The config provider to register
      load - Whether to load the config provider automatically
    • load

      public static void load(ConfigProvider provider)
      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

      public static void loadServerConfigs(Path worldPath)
      Load all server configs, setting the server config path and loading all server configs
      Parameters:
      worldPath - The path to the world
    • save

      public static void save(ConfigProvider configProvider)
      Save a config provider, checking if it's registered and saving the file
      Parameters:
      configProvider - The config provider to save
    • loadFile

      public static void loadFile(ConfigProvider provider)
      Load a config provider from a file, checking if it's registered and loading the file
      Parameters:
      provider - The config provider to load
    • onPlayerJoin

      public static void onPlayerJoin(EBPlayerJoinServerEvent event)
    • 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

      public static ArrayList<ConfigProvider> getConfigProviders()