kangarko / Foundation

Foundation™ helps you create highly customized Minecraft plugins (based on Spigot/Paper API) that support multiple MC versions.
https://mineacademy.org
305 stars 63 forks source link

Fix: Ensure native locales load on startup by adjusting settings initialization order #268

Closed IngPleb closed 5 months ago

IngPleb commented 5 months ago

Issue: Discovered that native locales for page button titles in menus were not loading correctly upon plugin startup. The issue was not apparent until the plugin was reloaded. Investigation revealed that this problem was rooted in the order in which locales were loaded in AutoRegisterScanner.java, affecting not only my plugin but also others like ChatControlRed.

Root Cause: Locale prefixes were not available in time for SimpleLocale to load the correct native locales due to the settings class loading sequence.

Fix: Modified the initialization sequence to load any settings classes before localisation classes. This ensures that locale prefixes are available early, allowing for the correct loading of native locales.

Side Note: The commit also includes some unintended file optimizations and reformatting by the IDE.

kangarko commented 5 months ago

Thanks!