diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_potion.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_potion.java index feab9776..31a55b8f 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_potion.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_potion.java @@ -186,7 +186,7 @@ public class Command_potion extends FreedomCommand { switch (args.length) { - case 1: + case 1 -> { List arguments = new ArrayList<>(Arrays.asList("list", "clear", "add")); if (plugin.al.isAdmin(sender)) @@ -195,56 +195,43 @@ public class Command_potion extends FreedomCommand } return arguments; } - - case 2: + case 2 -> { - if (args[0].equals("clear")) + if (args[0].equalsIgnoreCase("clear")) { if (plugin.al.isAdmin(sender)) { return FUtil.getPlayerList(); } } - else if (args[0].equals("add")) + else if (args[0].equalsIgnoreCase("add")) { return getAllPotionTypes(); } - break; } - - case 3: + case 3 -> { - if (args[0].equals("add")) + if (args[0].equalsIgnoreCase("add")) { return Collections.singletonList(""); } - break; } - - case 4: + case 4 -> { - if (args[0].equals("add")) + if (args[0].equalsIgnoreCase("add")) { return Collections.singletonList(""); } - break; } - - case 5: + case 5 -> { - if (plugin.al.isAdmin(sender)) + if (plugin.al.isAdmin(sender) && args[0].equalsIgnoreCase("add")) { - if (args[0].equals("add")) - { - return FUtil.getPlayerList(); - } + return FUtil.getPlayerList(); } - break; } - - default: + default -> { - break; } }