Skip to content

Commit

Permalink
Refactored Bungee Command Constructors
Browse files Browse the repository at this point in the history
  • Loading branch information
beanbeanjuice committed Jun 18, 2024
1 parent 073a0ca commit ff78ea0
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ff78ea0

Please sign in to comment.