Fix translations when using the CyanLibConfigCommands + the config screen for each mod now only has a 'Done' button, the options are automatically saved when exiting the screen
The functions that were rewritten for each type of option are now a single function.
This was made using a new interface called Option<T>
, where T
is the type of object the options will store
Use classes instead of a HashMap to store the options
🚧 Fixed :
- Crash on server launch (due to missing annotation
@Environment(EnvType.CLIENT)
) - Function
hasRule(String optionName, RULES rule)
was only checking for rules inInteger
options, notBoolean
ones
🫧 Changed :
MsgToActionBar
andMinOpLvlEditConfig
options are now centralized in this library, not each mod using this library
✏️ Added :
- A screen for the configuration (only works for the client options, but a screen will come to edit the server's options)
- The screen can be opened via ModMenu or in-game (not in a menu) using the default key
c
🚧 Fixed :
- If an option file was present (for a mod using this library) and contained options that were not in the default options, they were kept in the options
- If an option was in the default options but not in the options file, it was not added to the options
- When an option with the rule LOAD_CUSTOM_TRANSLATIONS was not exactly named "useCustomTranslations", the instances were not created correctly and the custom translations were not loaded correctly
🫧 Changed :
- Entirely remade the config system to use a
class
instead of aMap
(which make it usable with screens)
✏️ Added :
- The config commands are now instanciated in this library instead of in each mod
- The rule
LOAD_CUSTOM_TRANSLATIONS
, which can be held by only 1 option and will tell the mod when to load / unload the custom translations (when this option is changed)
✏️ Added :
- Rules for options, like a minimum and / or maximum value for the integer options
🚧 Fixed :
- Translation errors + some typos in javadocs
- Translation path to get the options descriptions was missing 'getDesc' in CyanLibCommands#getOptionChatConfig()
✏️ Added :
- The possibility to instantiate the CyanLib class without the language utils
🚧 Fixed :
- Some typos in the javadocs
- A translation issue