From 1face9bf59ebdcdb318d71d9d23db95b5218a2f2 Mon Sep 17 00:00:00 2001 From: srnyx <25808801+srnyx@users.noreply.github.com> Date: Fri, 30 Dec 2022 15:40:00 -0500 Subject: [PATCH] Add `loadMessages()` and more changes - `messages.yml` loading has been moved into it's own method, `AnnoyingPlugin#loadMessages()` - Removed translating some of the message options keys into their strings from `messages.yml` - Getting missing dependencies and their names improved --- .../xyz/srnyx/annoyingapi/AnnoyingPlugin.java | 32 ++++++++++--------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/api/src/main/java/xyz/srnyx/annoyingapi/AnnoyingPlugin.java b/api/src/main/java/xyz/srnyx/annoyingapi/AnnoyingPlugin.java index 707b161..dd59436 100644 --- a/api/src/main/java/xyz/srnyx/annoyingapi/AnnoyingPlugin.java +++ b/api/src/main/java/xyz/srnyx/annoyingapi/AnnoyingPlugin.java @@ -62,15 +62,19 @@ public AnnoyingPlugin() { */ @Override public final void onLoad() { - messages = new AnnoyingResource(this, options.messagesFileName); - options.prefix = getMessagesString(options.prefix); - options.splitterJson = getMessagesString(options.splitterJson); - options.splitterPlaceholder = getMessagesString(options.splitterPlaceholder); - + // Load messages + loadMessages(); // Custom onLoad load(); } + /** + * Loads the messages.yml file + */ + public void loadMessages() { + messages = new AnnoyingResource(this, options.messagesFileName); + } + /** * Called when the plugin is enabled. *
Do not try to override this method! Override {@link #enable()} instead
@@ -103,14 +107,12 @@ public final void onEnable() {
*/
private void enablePlugin() {
// Check if required dependencies are installed
- final Set