Package net.lcc.sollib.api.common.config
Class SConfigRegistry
java.lang.Object
net.lcc.sollib.api.common.config.SConfigRegistry
- All Implemented Interfaces:
SEventListener
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@Nullable SolConfig<T> TgetAll()<T> com.google.gson.JsonElementvoidAutomatically called by any SolConfig in its constructorvoidregisterEvents(Consumer<SEventType<?>> registrar) Pass each of your customSEventTypes to this to register them to the system
No need to implement if you only want to *use* SEventsvoidreload()Reloads every config registered, reading their file and fetching the required ConfigEntry
Automatically called on resource reloadMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.lcc.sollib.api.event.SEventListener
onConfigBuild, onPreload, onReload
-
Field Details
-
INSTANCE
-
LOG
-
-
Constructor Details
-
SConfigRegistry
public SConfigRegistry()
-
-
Method Details
-
get
- Parameters:
name- The name of the config to get- Returns:
- The corresponding SolConfig instance, or null
-
getAll
- Returns:
- An iterator over every registered SolConfig
-
get
- 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
-
register
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 -
registerEvents
Description copied from interface:SEventListenerPass each of your customSEventTypes to this to register them to the system
No need to implement if you only want to *use* SEvents- Specified by:
registerEventsin interfaceSEventListener
-