From ff78ea077f750c6e3974344e1d094da983d93d79 Mon Sep 17 00:00:00 2001 From: beanbeanjuice Date: Mon, 17 Jun 2024 21:21:06 -0400 Subject: [PATCH] Refactored Bungee Command Constructors --- .../simpleproxychat/SimpleProxyChatBungee.java | 8 ++++---- .../commands/bungee/BungeeChatToggleCommand.java | 4 ++-- .../commands/bungee/BungeeReloadCommand.java | 4 ++-- .../commands/bungee/whisper/BungeeReplyCommand.java | 4 ++-- .../commands/bungee/whisper/BungeeWhisperCommand.java | 4 ++-- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/main/java/com/beanbeanjuice/simpleproxychat/SimpleProxyChatBungee.java b/src/main/java/com/beanbeanjuice/simpleproxychat/SimpleProxyChatBungee.java index f6e276b..3bd058a 100644 --- a/src/main/java/com/beanbeanjuice/simpleproxychat/SimpleProxyChatBungee.java +++ b/src/main/java/com/beanbeanjuice/simpleproxychat/SimpleProxyChatBungee.java @@ -185,10 +185,10 @@ private void registerListeners() { } private void registerCommands() { - this.getProxy().getPluginManager().registerCommand(this, new BungeeReloadCommand(this, config)); - this.getProxy().getPluginManager().registerCommand(this, new BungeeChatToggleCommand(this, config)); - this.getProxy().getPluginManager().registerCommand(this, new BungeeWhisperCommand(this, config, config.getAsArrayList(ConfigDataKey.WHISPER_ALIASES).toArray(new String[0]))); - this.getProxy().getPluginManager().registerCommand(this, new BungeeReplyCommand(this, config, config.getAsArrayList(ConfigDataKey.REPLY_ALIASES).toArray(new String[0]))); + this.getProxy().getPluginManager().registerCommand(this, new BungeeReloadCommand(this)); + this.getProxy().getPluginManager().registerCommand(this, new BungeeChatToggleCommand(this)); + this.getProxy().getPluginManager().registerCommand(this, new BungeeWhisperCommand(this, config.getAsArrayList(ConfigDataKey.WHISPER_ALIASES).toArray(new String[0]))); + this.getProxy().getPluginManager().registerCommand(this, new BungeeReplyCommand(this, config.getAsArrayList(ConfigDataKey.REPLY_ALIASES).toArray(new String[0]))); this.getProxy().getPluginManager().registerCommand(this, new BungeeBroadcastCommand(this)); // Only enable when needed. diff --git a/src/main/java/com/beanbeanjuice/simpleproxychat/commands/bungee/BungeeChatToggleCommand.java b/src/main/java/com/beanbeanjuice/simpleproxychat/commands/bungee/BungeeChatToggleCommand.java index bf44c00..edada75 100644 --- a/src/main/java/com/beanbeanjuice/simpleproxychat/commands/bungee/BungeeChatToggleCommand.java +++ b/src/main/java/com/beanbeanjuice/simpleproxychat/commands/bungee/BungeeChatToggleCommand.java @@ -21,10 +21,10 @@ public class BungeeChatToggleCommand extends Command implements TabExecutor { private final SimpleProxyChatBungee plugin; private final Config config; - public BungeeChatToggleCommand(SimpleProxyChatBungee plugin, Config config) { + public BungeeChatToggleCommand(final SimpleProxyChatBungee plugin) { super("Spc-chat"); this.plugin = plugin; - this.config = config; + this.config = plugin.getConfig(); } @Override diff --git a/src/main/java/com/beanbeanjuice/simpleproxychat/commands/bungee/BungeeReloadCommand.java b/src/main/java/com/beanbeanjuice/simpleproxychat/commands/bungee/BungeeReloadCommand.java index 2b7a853..0e8dba3 100644 --- a/src/main/java/com/beanbeanjuice/simpleproxychat/commands/bungee/BungeeReloadCommand.java +++ b/src/main/java/com/beanbeanjuice/simpleproxychat/commands/bungee/BungeeReloadCommand.java @@ -15,10 +15,10 @@ public class BungeeReloadCommand extends Command { private final SimpleProxyChatBungee plugin; private final Config config; - public BungeeReloadCommand(SimpleProxyChatBungee plugin, Config config) { + public BungeeReloadCommand(final SimpleProxyChatBungee plugin) { super("Spc-reload"); this.plugin = plugin; - this.config = config; + this.config = plugin.getConfig(); } @Override diff --git a/src/main/java/com/beanbeanjuice/simpleproxychat/commands/bungee/whisper/BungeeReplyCommand.java b/src/main/java/com/beanbeanjuice/simpleproxychat/commands/bungee/whisper/BungeeReplyCommand.java index 9c1911d..76b2403 100644 --- a/src/main/java/com/beanbeanjuice/simpleproxychat/commands/bungee/whisper/BungeeReplyCommand.java +++ b/src/main/java/com/beanbeanjuice/simpleproxychat/commands/bungee/whisper/BungeeReplyCommand.java @@ -17,10 +17,10 @@ public class BungeeReplyCommand extends Command { private final SimpleProxyChatBungee plugin; private final Config config; - public BungeeReplyCommand(SimpleProxyChatBungee plugin, Config config, String... aliases) { + public BungeeReplyCommand(final SimpleProxyChatBungee plugin, String... aliases) { super("Spc-reply", Permission.COMMAND_WHISPER.getPermissionNode(), aliases); this.plugin = plugin;; - this.config = config; + this.config = plugin.getConfig(); } @Override diff --git a/src/main/java/com/beanbeanjuice/simpleproxychat/commands/bungee/whisper/BungeeWhisperCommand.java b/src/main/java/com/beanbeanjuice/simpleproxychat/commands/bungee/whisper/BungeeWhisperCommand.java index db350b4..55abf01 100644 --- a/src/main/java/com/beanbeanjuice/simpleproxychat/commands/bungee/whisper/BungeeWhisperCommand.java +++ b/src/main/java/com/beanbeanjuice/simpleproxychat/commands/bungee/whisper/BungeeWhisperCommand.java @@ -21,10 +21,10 @@ public class BungeeWhisperCommand extends Command implements TabExecutor { private final SimpleProxyChatBungee plugin; private final Config config; - public BungeeWhisperCommand(SimpleProxyChatBungee plugin, Config config, String... aliases) { + public BungeeWhisperCommand(final SimpleProxyChatBungee plugin, String... aliases) { super("Spc-whisper", Permission.COMMAND_WHISPER.getPermissionNode(), aliases); this.plugin = plugin; - this.config = config; + this.config = plugin.getConfig(); } @Override