Package com.codinglitch.lexiconfig
Class LexiconfigApi
java.lang.Object
com.codinglitch.lexiconfig.LexiconfigApi
- Direct Known Subclasses:
Lexiconfig
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThese are all the available event types for use inside theregisterListenermethod.static enumThese are the possible extensions to save the config as.static enumThese are the possible locations to store a lexicon at. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic LexiconfigApiprotected static final Map<Consumer<LexiconEvent>,LexiconfigApi.EventType> protected static final List<LexiconData> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcallEvent(LexiconfigApi.EventType eventType, LexiconEvent event) static voidstatic voidfindLibrary(String id) Searches for a library with the matching mod ID.abstract PathgetConfigPath(LexiconfigApi.Location location) This is used to retrieve the configuration folder path, dependent on the modloader.static voidstatic <E extends LexiconEvent>
voidregisterListener(LexiconfigApi.EventType eventType, Consumer<E> listener) This used to register a listener of a certain type, which is fired in various parts of the lifecycle.static voidshelveLexicon(Library library, LexiconData lexicon) This method is used to shelve a lexicon to be registered for reloading events, etc.static void
-
Field Details
-
SHELVED_LEXICONS
-
LISTENERS
-
LIBRARIES
-
INSTANCE
-
-
Constructor Details
-
LexiconfigApi
public LexiconfigApi()
-
-
Method Details
-
info
-
debug
-
warn
-
error
-
shelveLexicon
This method is used to shelve a lexicon to be registered for reloading events, etc. and should be called within theshelveLexiconsmethod of aLexiconLibrary.- Parameters:
library- The library to shelve the lexicon inlexicon- The lexicon to shelve- See Also:
-
findLibrary
Searches for a library with the matching mod ID.- Parameters:
id- The id of the mod to search for- Returns:
- The library, if found
- See Also:
-
registerListener
public static <E extends LexiconEvent> void registerListener(LexiconfigApi.EventType eventType, Consumer<E> listener) This used to register a listener of a certain type, which is fired in various parts of the lifecycle. -
callEvent
-
getConfigPath
This is used to retrieve the configuration folder path, dependent on the modloader.- Returns:
- The path of the config folder
-