From 49b30f5f50626c639c32daf4e6e2cffed39800c1 Mon Sep 17 00:00:00 2001 From: Brianna Date: Tue, 8 Sep 2020 10:55:29 -0500 Subject: [PATCH] Cleaned up commands. --- .../songoda/ultimatekits/UltimateKits.java | 20 +++++------ .../commands/CommandCategories.java | 7 ++-- .../ultimatekits/commands/CommandCrate.java | 1 - .../commands/CommandCreatekit.java | 19 +++++----- .../ultimatekits/commands/CommandEdit.java | 23 ++++++------ .../ultimatekits/commands/CommandKey.java | 25 ++++++------- .../ultimatekits/commands/CommandKit.java | 35 ++++++++++--------- .../commands/CommandPreviewKit.java | 15 ++++---- .../ultimatekits/commands/CommandReload.java | 11 +++--- .../ultimatekits/commands/CommandRemove.java | 15 ++++---- .../ultimatekits/commands/CommandSet.java | 17 ++++----- .../commands/CommandSettings.java | 11 +++--- 12 files changed, 104 insertions(+), 95 deletions(-) diff --git a/src/main/java/com/songoda/ultimatekits/UltimateKits.java b/src/main/java/com/songoda/ultimatekits/UltimateKits.java index 22d9a63..5fd7687 100644 --- a/src/main/java/com/songoda/ultimatekits/UltimateKits.java +++ b/src/main/java/com/songoda/ultimatekits/UltimateKits.java @@ -140,17 +140,17 @@ public class UltimateKits extends SongodaPlugin { // setup commands this.commandManager = new CommandManager(this); - this.commandManager.addCommand(new CommandKit(guiManager)); - this.commandManager.addCommand(new CommandPreviewKit(guiManager)); + this.commandManager.addCommand(new CommandKit(this, guiManager)); + this.commandManager.addCommand(new CommandPreviewKit(this, guiManager)); this.commandManager.addMainCommand("KitAdmin") - .addSubCommand(new CommandReload()) - .addSubCommand(new CommandSettings(guiManager)) - .addSubCommand(new CommandCreatekit(guiManager)) - .addSubCommand(new CommandCategories(guiManager)) - .addSubCommand(new CommandEdit(guiManager)) - .addSubCommand(new CommandKey()) - .addSubCommand(new CommandSet()) - .addSubCommand(new CommandRemove()) + .addSubCommand(new CommandReload(this)) + .addSubCommand(new CommandSettings(this, guiManager)) + .addSubCommand(new CommandCreatekit(this, guiManager)) + .addSubCommand(new CommandCategories(this, guiManager)) + .addSubCommand(new CommandEdit(this, guiManager)) + .addSubCommand(new CommandKey(this)) + .addSubCommand(new CommandSet(this)) + .addSubCommand(new CommandRemove(this)) .addSubCommand(new CommandCrate()); diff --git a/src/main/java/com/songoda/ultimatekits/commands/CommandCategories.java b/src/main/java/com/songoda/ultimatekits/commands/CommandCategories.java index 96e09bd..200610d 100644 --- a/src/main/java/com/songoda/ultimatekits/commands/CommandCategories.java +++ b/src/main/java/com/songoda/ultimatekits/commands/CommandCategories.java @@ -11,11 +11,12 @@ import java.util.List; public class CommandCategories extends AbstractCommand { - final UltimateKits plugin = UltimateKits.getInstance(); - final GuiManager guiManager; + private final UltimateKits plugin; + private final GuiManager guiManager; - public CommandCategories(GuiManager guiManager) { + public CommandCategories(UltimateKits plugin, GuiManager guiManager) { super(CommandType.PLAYER_ONLY, "categories"); + this.plugin = plugin; this.guiManager = guiManager; } diff --git a/src/main/java/com/songoda/ultimatekits/commands/CommandCrate.java b/src/main/java/com/songoda/ultimatekits/commands/CommandCrate.java index 23baadb..e02fb07 100644 --- a/src/main/java/com/songoda/ultimatekits/commands/CommandCrate.java +++ b/src/main/java/com/songoda/ultimatekits/commands/CommandCrate.java @@ -24,7 +24,6 @@ public class CommandCrate extends AbstractCommand { @Override protected ReturnType runCommand(CommandSender sender, String... args) { - if (args.length < 3 || args.length > 4) return ReturnType.SYNTAX_ERROR; OfflinePlayer target = Bukkit.getPlayer(args[0]); diff --git a/src/main/java/com/songoda/ultimatekits/commands/CommandCreatekit.java b/src/main/java/com/songoda/ultimatekits/commands/CommandCreatekit.java index f6fc36a..e48e437 100644 --- a/src/main/java/com/songoda/ultimatekits/commands/CommandCreatekit.java +++ b/src/main/java/com/songoda/ultimatekits/commands/CommandCreatekit.java @@ -13,11 +13,12 @@ import java.util.List; public class CommandCreatekit extends AbstractCommand { - final UltimateKits instance = UltimateKits.getInstance(); - final GuiManager guiManager; + private final UltimateKits plugin; + private final GuiManager guiManager; - public CommandCreatekit(GuiManager guiManager) { - super(true, "createkit"); + public CommandCreatekit(UltimateKits plugin, GuiManager guiManager) { + super(CommandType.PLAYER_ONLY, "createkit"); + this.plugin = plugin; this.guiManager = guiManager; } @@ -28,15 +29,15 @@ public class CommandCreatekit extends AbstractCommand { return ReturnType.SYNTAX_ERROR; } String kitStr = args[0].toLowerCase(); - if (instance.getKitManager().getKit(kitStr) != null) { - instance.getLocale().getMessage("command.kit.kitalreadyexists").sendPrefixedMessage(player); + if (plugin.getKitManager().getKit(kitStr) != null) { + plugin.getLocale().getMessage("command.kit.kitalreadyexists").sendPrefixedMessage(player); return ReturnType.FAILURE; } - instance.getLocale().newMessage("&aThat kit doesn't exist. Creating it now.").sendPrefixedMessage(player); + plugin.getLocale().newMessage("&aThat kit doesn't exist. Creating it now.").sendPrefixedMessage(player); Kit kit = new Kit(kitStr.trim()); - UltimateKits.getInstance().getKitManager().addKit(kit); - guiManager.showGUI(player, new KitEditorGui(instance, player, kit, null)); + plugin.getKitManager().addKit(kit); + guiManager.showGUI(player, new KitEditorGui(plugin, player, kit, null)); return ReturnType.SUCCESS; } diff --git a/src/main/java/com/songoda/ultimatekits/commands/CommandEdit.java b/src/main/java/com/songoda/ultimatekits/commands/CommandEdit.java index 8a06787..9c92015 100644 --- a/src/main/java/com/songoda/ultimatekits/commands/CommandEdit.java +++ b/src/main/java/com/songoda/ultimatekits/commands/CommandEdit.java @@ -16,11 +16,12 @@ import java.util.List; public class CommandEdit extends AbstractCommand { - final UltimateKits instance = UltimateKits.getInstance(); - final GuiManager guiManager; + private final UltimateKits plugin; + private final GuiManager guiManager; - public CommandEdit(GuiManager guiManager) { - super(true, "edit"); + public CommandEdit(UltimateKits plugin, GuiManager guiManager) { + super(CommandType.PLAYER_ONLY, "edit"); + this.plugin = plugin; this.guiManager = guiManager; } @@ -31,20 +32,20 @@ public class CommandEdit extends AbstractCommand { if (args.length == 0) { Block block = player.getTargetBlock(null, 200); - KitBlockData kitBlockData = instance.getKitManager().getKit(block.getLocation()); + KitBlockData kitBlockData = plugin.getKitManager().getKit(block.getLocation()); if (kitBlockData == null) { - instance.getLocale().newMessage("command.kit.nokitatblock").sendPrefixedMessage(player); + plugin.getLocale().newMessage("command.kit.nokitatblock").sendPrefixedMessage(player); return ReturnType.FAILURE; } - guiManager.showGUI(player, new BlockEditorGui(instance, kitBlockData)); + guiManager.showGUI(player, new BlockEditorGui(plugin, kitBlockData)); } else { String kitStr = args[0].toLowerCase().trim(); - if (instance.getKitManager().getKit(kitStr) == null) { - instance.getLocale().getMessage("command.kit.kitdoesntexist").sendPrefixedMessage(player); + if (plugin.getKitManager().getKit(kitStr) == null) { + plugin.getLocale().getMessage("command.kit.kitdoesntexist").sendPrefixedMessage(player); return ReturnType.FAILURE; } - guiManager.showGUI(player, new KitEditorGui(instance, player, instance.getKitManager().getKit(kitStr), null)); + guiManager.showGUI(player, new KitEditorGui(plugin, player, plugin.getKitManager().getKit(kitStr), null)); } return ReturnType.SUCCESS; } @@ -53,7 +54,7 @@ public class CommandEdit extends AbstractCommand { protected List onTab(CommandSender sender, String... args) { List tab = new ArrayList<>(); if (args.length == 1) { - for (Kit kit : UltimateKits.getInstance().getKitManager().getKits()) + for (Kit kit : plugin.getKitManager().getKits()) tab.add(kit.getKey()); return tab; } diff --git a/src/main/java/com/songoda/ultimatekits/commands/CommandKey.java b/src/main/java/com/songoda/ultimatekits/commands/CommandKey.java index 12658d2..99fd7fd 100644 --- a/src/main/java/com/songoda/ultimatekits/commands/CommandKey.java +++ b/src/main/java/com/songoda/ultimatekits/commands/CommandKey.java @@ -16,10 +16,11 @@ import java.util.List; public class CommandKey extends AbstractCommand { - final UltimateKits instance = UltimateKits.getInstance(); + private final UltimateKits plugin; - public CommandKey() { - super(false, "key"); + public CommandKey(UltimateKits plugin) { + super(CommandType.PLAYER_ONLY, "key"); + this.plugin = plugin; } @Override @@ -27,14 +28,14 @@ public class CommandKey extends AbstractCommand { if (args.length != 3 && args.length != 4) { return ReturnType.SYNTAX_ERROR; } - Kit kit = instance.getKitManager().getKit(args[0]); + Kit kit = plugin.getKitManager().getKit(args[0]); if (kit == null && !args[0].toLowerCase().equals("all")) { - instance.getLocale().getMessage("command.kit.kitdoesntexist").sendPrefixedMessage(sender); + plugin.getLocale().getMessage("command.kit.kitdoesntexist").sendPrefixedMessage(sender); return ReturnType.FAILURE; } Player playerTo = null; if (!args[2].trim().equalsIgnoreCase("all") && (playerTo = Bukkit.getPlayer(args[2])) == null) { - instance.getLocale().newMessage("&cThat username does not exist, or the user is offline!").sendPrefixedMessage(sender); + plugin.getLocale().newMessage("&cThat username does not exist, or the user is offline!").sendPrefixedMessage(sender); return ReturnType.FAILURE; } int amt = 1; @@ -46,27 +47,27 @@ public class CommandKey extends AbstractCommand { } } if (amt == 0) { - instance.getLocale().newMessage("&a" + args[3] + " &cis not a number.").sendPrefixedMessage(sender); + plugin.getLocale().newMessage("&a" + args[3] + " &cis not a number.").sendPrefixedMessage(sender); return ReturnType.FAILURE; } - Key key = instance.getKeyManager().getKey(args[1]); + Key key = plugin.getKeyManager().getKey(args[1]); if (key == null) { - instance.getLocale().newMessage("&a" + args[1] + " &cis not a key.").sendPrefixedMessage(sender); + plugin.getLocale().newMessage("&a" + args[1] + " &cis not a key.").sendPrefixedMessage(sender); return ReturnType.FAILURE; } if (playerTo != null) { PlayerUtils.giveItem(playerTo, key.getKeyItem(kit, amt)); - instance.getLocale().getMessage("event.key.given") + plugin.getLocale().getMessage("event.key.given") .processPlaceholder("kit", kit == null ? "Any" : kit.getName()) .sendPrefixedMessage(playerTo); return ReturnType.SUCCESS; } - for (Player pl : instance.getServer().getOnlinePlayers()) { + for (Player pl : plugin.getServer().getOnlinePlayers()) { PlayerUtils.giveItem(pl, key.getKeyItem(kit, amt)); - instance.getLocale().getMessage("event.key.given") + plugin.getLocale().getMessage("event.key.given") .processPlaceholder("kit", kit == null ? "Any" : kit.getName()) .sendPrefixedMessage(pl); } diff --git a/src/main/java/com/songoda/ultimatekits/commands/CommandKit.java b/src/main/java/com/songoda/ultimatekits/commands/CommandKit.java index d97b940..8133838 100644 --- a/src/main/java/com/songoda/ultimatekits/commands/CommandKit.java +++ b/src/main/java/com/songoda/ultimatekits/commands/CommandKit.java @@ -15,11 +15,12 @@ import java.util.List; public class CommandKit extends AbstractCommand { - final UltimateKits instance = UltimateKits.getInstance(); - final GuiManager guiManager; + private final UltimateKits plugin; + private final GuiManager guiManager; - public CommandKit(GuiManager guiManager) { - super(false, "kit"); + public CommandKit(UltimateKits plugin, GuiManager guiManager) { + super(CommandType.PLAYER_ONLY, "kit"); + this.plugin = plugin; this.guiManager = guiManager; } @@ -29,19 +30,19 @@ public class CommandKit extends AbstractCommand { if (args.length == 0 && sender instanceof Player) { // /kit - Opens GUI. - if (instance.getKitManager().getKits().stream().anyMatch(kit -> kit.getCategory() != null)) - guiManager.showGUI((Player) sender, new CategorySelectorGui(instance, (Player) sender)); + if (plugin.getKitManager().getKits().stream().anyMatch(kit -> kit.getCategory() != null)) + guiManager.showGUI((Player) sender, new CategorySelectorGui(plugin, (Player) sender)); else - guiManager.showGUI((Player) sender, new KitSelectorGui(instance, (Player) sender, null)); + guiManager.showGUI((Player) sender, new KitSelectorGui(plugin, (Player) sender, null)); return ReturnType.SUCCESS; } - if (instance.getKitManager().getKit(args[0]) == null) { - instance.getLocale().getMessage("command.kit.kitdoesntexist").sendPrefixedMessage(sender); + if (plugin.getKitManager().getKit(args[0]) == null) { + plugin.getLocale().getMessage("command.kit.kitdoesntexist").sendPrefixedMessage(sender); return ReturnType.FAILURE; } - Kit kit = instance.getKitManager().getKit(args[0]); + Kit kit = plugin.getKitManager().getKit(args[0]); if (args.length == 1) { // /kit - Gives kit to self. @@ -49,7 +50,7 @@ public class CommandKit extends AbstractCommand { return ReturnType.NEEDS_PLAYER; if (!kit.hasPermissionToClaim((Player) sender)) { - instance.getLocale().getMessage("command.general.noperms").sendPrefixedMessage(sender); + plugin.getLocale().getMessage("command.general.noperms").sendPrefixedMessage(sender); return ReturnType.FAILURE; } @@ -59,12 +60,12 @@ public class CommandKit extends AbstractCommand { // /kit - Gives kit to another player. if (!sender.hasPermission("ultimatekits.admin")) { - instance.getLocale().getMessage("command.general.noperms").sendPrefixedMessage(sender); + plugin.getLocale().getMessage("command.general.noperms").sendPrefixedMessage(sender); return ReturnType.FAILURE; } if (!args[1].equalsIgnoreCase("all") && Bukkit.getPlayer(args[1]) == null) { - instance.getLocale().newMessage("&cThat username does not exist, or the user is offline!").sendPrefixedMessage(sender); + plugin.getLocale().newMessage("&cThat username does not exist, or the user is offline!").sendPrefixedMessage(sender); return ReturnType.FAILURE; } @@ -73,19 +74,19 @@ public class CommandKit extends AbstractCommand { if (player != null) { kit.processGenericUse(player, true); - instance.getLocale().getMessage("event.claim.givesuccess") + plugin.getLocale().getMessage("event.claim.givesuccess") .processPlaceholder("kit", kit.getName()) .sendPrefixedMessage(sender); } else { Bukkit.getOnlinePlayers().forEach(onlinePlayer -> { kit.processGenericUse(onlinePlayer, true); - instance.getLocale().getMessage("event.claim.givesuccess") + plugin.getLocale().getMessage("event.claim.givesuccess") .processPlaceholder("kit", kit.getName()) .sendPrefixedMessage(sender); }); } - instance.getLocale().newMessage("&7You gave &9" + who + "&7 kit &9" + kit.getName() + "&7.") + plugin.getLocale().newMessage("&7You gave &9" + who + "&7 kit &9" + kit.getName() + "&7.") .sendPrefixedMessage(sender); return ReturnType.SUCCESS; } @@ -100,7 +101,7 @@ public class CommandKit extends AbstractCommand { if (!(sender instanceof Player)) return tab; if (args.length == 1) { - for (Kit kit : instance.getKitManager().getKits()) tab.add(kit.getKey()); + for (Kit kit : plugin.getKitManager().getKits()) tab.add(kit.getKey()); } else if (args.length == 2) { tab.add("all"); Bukkit.getOnlinePlayers().forEach(player -> tab.add(player.getName())); diff --git a/src/main/java/com/songoda/ultimatekits/commands/CommandPreviewKit.java b/src/main/java/com/songoda/ultimatekits/commands/CommandPreviewKit.java index bdff49f..d448eee 100644 --- a/src/main/java/com/songoda/ultimatekits/commands/CommandPreviewKit.java +++ b/src/main/java/com/songoda/ultimatekits/commands/CommandPreviewKit.java @@ -12,11 +12,12 @@ import java.util.List; public class CommandPreviewKit extends AbstractCommand { - final UltimateKits instance = UltimateKits.getInstance(); - final GuiManager guiManager; + private final UltimateKits plugin; + private final GuiManager guiManager; - public CommandPreviewKit(GuiManager guiManager) { - super(true, "PreviewKit"); + public CommandPreviewKit(UltimateKits plugin, GuiManager guiManager) { + super(CommandType.PLAYER_ONLY, "PreviewKit"); + this.plugin = plugin; this.guiManager = guiManager; } @@ -24,12 +25,12 @@ public class CommandPreviewKit extends AbstractCommand { protected ReturnType runCommand(CommandSender sender, String... args) { Player player = (Player) sender; if (args.length != 1) { - instance.getLocale().getMessage("command.kit.nokitsupplied").sendPrefixedMessage(player); + plugin.getLocale().getMessage("command.kit.nokitsupplied").sendPrefixedMessage(player); return ReturnType.FAILURE; } - Kit kit = instance.getKitManager().getKit(args[0].toLowerCase().trim()); + Kit kit = plugin.getKitManager().getKit(args[0].toLowerCase().trim()); if (kit == null) { - instance.getLocale().getMessage("command.kit.kitdoesntexist").sendPrefixedMessage(player); + plugin.getLocale().getMessage("command.kit.kitdoesntexist").sendPrefixedMessage(player); return ReturnType.FAILURE; } kit.display(player, guiManager, null); diff --git a/src/main/java/com/songoda/ultimatekits/commands/CommandReload.java b/src/main/java/com/songoda/ultimatekits/commands/CommandReload.java index 1e4df6d..1e42ce0 100644 --- a/src/main/java/com/songoda/ultimatekits/commands/CommandReload.java +++ b/src/main/java/com/songoda/ultimatekits/commands/CommandReload.java @@ -9,16 +9,17 @@ import java.util.List; public class CommandReload extends AbstractCommand { - final UltimateKits instance = UltimateKits.getInstance(); + private final UltimateKits plugin; - public CommandReload() { - super(false, "reload"); + public CommandReload(UltimateKits plugin) { + super(CommandType.CONSOLE_OK, "reload"); + this.plugin = plugin; } @Override protected ReturnType runCommand(CommandSender sender, String... args) { - instance.reloadConfig(); - instance.getLocale().getMessage("&7Configuration and Language files reloaded.").sendPrefixedMessage(sender); + plugin.reloadConfig(); + plugin.getLocale().getMessage("&7Configuration and Language files reloaded.").sendPrefixedMessage(sender); return ReturnType.SUCCESS; } diff --git a/src/main/java/com/songoda/ultimatekits/commands/CommandRemove.java b/src/main/java/com/songoda/ultimatekits/commands/CommandRemove.java index 5f02d52..0be7f8c 100644 --- a/src/main/java/com/songoda/ultimatekits/commands/CommandRemove.java +++ b/src/main/java/com/songoda/ultimatekits/commands/CommandRemove.java @@ -13,26 +13,27 @@ import java.util.List; public class CommandRemove extends AbstractCommand { - final UltimateKits instance = UltimateKits.getInstance(); + private final UltimateKits plugin; - public CommandRemove() { - super(true, "remove"); + public CommandRemove(UltimateKits plugin) { + super(CommandType.PLAYER_ONLY, "remove"); + this.plugin = plugin; } @Override protected ReturnType runCommand(CommandSender sender, String... args) { Player player = (Player) sender; Block block = player.getTargetBlock(null, 200); - Kit kit = instance.getKitManager().removeKitFromLocation(block.getLocation()); + Kit kit = plugin.getKitManager().removeKitFromLocation(block.getLocation()); if (kit == null) return ReturnType.FAILURE; if (HologramManager.isEnabled()) { - instance.getKitManager().getKitLocations().values().stream() + plugin.getKitManager().getKitLocations().values().stream() .filter(data -> data.getKit() == kit) - .forEach(data -> instance.removeHologram(data)); + .forEach(data -> plugin.removeHologram(data)); } - instance.getLocale().newMessage("&8Kit &9" + kit.getKey() + " &8unassigned from: &a" + block.getType().toString() + "&8.").sendPrefixedMessage(player); + plugin.getLocale().newMessage("&8Kit &9" + kit.getKey() + " &8unassigned from: &a" + block.getType().toString() + "&8.").sendPrefixedMessage(player); return ReturnType.SUCCESS; } diff --git a/src/main/java/com/songoda/ultimatekits/commands/CommandSet.java b/src/main/java/com/songoda/ultimatekits/commands/CommandSet.java index 5866d07..04ff73f 100644 --- a/src/main/java/com/songoda/ultimatekits/commands/CommandSet.java +++ b/src/main/java/com/songoda/ultimatekits/commands/CommandSet.java @@ -13,28 +13,29 @@ import java.util.List; public class CommandSet extends AbstractCommand { - final UltimateKits instance = UltimateKits.getInstance(); + private final UltimateKits plugin; - public CommandSet() { - super(true, "set"); + public CommandSet(UltimateKits plugin) { + super(CommandType.PLAYER_ONLY, "set"); + this.plugin = plugin; } @Override protected ReturnType runCommand(CommandSender sender, String... args) { if (args.length != 1) { - instance.getLocale().getMessage("command.kit.nokitsupplied").sendPrefixedMessage(sender); + plugin.getLocale().getMessage("command.kit.nokitsupplied").sendPrefixedMessage(sender); return ReturnType.FAILURE; } Player player = (Player) sender; - Kit kit = instance.getKitManager().getKit(args[0].toLowerCase()); + Kit kit = plugin.getKitManager().getKit(args[0].toLowerCase()); if (kit == null) { - instance.getLocale().getMessage("command.kit.kitdoesntexist").sendPrefixedMessage(sender); + plugin.getLocale().getMessage("command.kit.kitdoesntexist").sendPrefixedMessage(sender); return ReturnType.FAILURE; } Block b = player.getTargetBlock(null, 200); - KitBlockData data = instance.getKitManager().addKitToLocation(kit, b.getLocation()); + KitBlockData data = plugin.getKitManager().addKitToLocation(kit, b.getLocation()); UltimateKits.getInstance().getDataManager().createBlockData(data); - instance.getLocale().newMessage("&8Kit &a" + kit.getKey() + " &8set to: &a" + b.getType().toString() + "&8.") + plugin.getLocale().newMessage("&8Kit &a" + kit.getKey() + " &8set to: &a" + b.getType().toString() + "&8.") .sendPrefixedMessage(sender); return ReturnType.SUCCESS; diff --git a/src/main/java/com/songoda/ultimatekits/commands/CommandSettings.java b/src/main/java/com/songoda/ultimatekits/commands/CommandSettings.java index 669520f..c596d28 100644 --- a/src/main/java/com/songoda/ultimatekits/commands/CommandSettings.java +++ b/src/main/java/com/songoda/ultimatekits/commands/CommandSettings.java @@ -12,17 +12,18 @@ import java.util.List; public class CommandSettings extends AbstractCommand { - final UltimateKits instance = UltimateKits.getInstance(); - final GuiManager guiManager; + private final UltimateKits plugin; + private final GuiManager guiManager; - public CommandSettings(GuiManager guiManager) { - super(true, "settings"); + public CommandSettings(UltimateKits plugin, GuiManager guiManager) { + super(CommandType.PLAYER_ONLY, "settings"); + this.plugin = plugin; this.guiManager = guiManager; } @Override protected ReturnType runCommand(CommandSender sender, String... args) { - guiManager.showGUI((Player) sender, new PluginConfigGui(instance)); + guiManager.showGUI((Player) sender, new PluginConfigGui(plugin)); return ReturnType.SUCCESS; }