Class SConfigRegistry

java.lang.Object
net.lcc.sollib.api.common.config.SConfigRegistry

public class SConfigRegistry extends Object
  • Field Details

  • Method Details

    • get

      @Nullable public @Nullable SolConfig get(String name)
      Parameters:
      name - The name of the config to get
      Returns:
      The corresponding SolConfig instance, or null
    • get

      public <T> T get(String entry, T fallback)
      Parameters:
      entry - The identifier for a config entry, a String formatted as "configname:entrypath"
      fallback - The fallback value to return if the config or path doesn't exist
      Returns:
      The value associated with said entry, or fallback if it doesn't exist
    • getRaw

      public <T> com.google.gson.JsonElement getRaw(String entry, T fallback)
    • register

      public void register(SolConfig config)
      Automatically called by any SolConfig in its constructor
      Parameters:
      config - The instance of SolConfig to register
    • reload

      @Internal public void reload()
      Reloads every config registered, reading their file and fetching the required ConfigEntry
      Automatically called on resource reload