From 3d67c83ea4dda677ccfc1e3b295c1e24b628e430 Mon Sep 17 00:00:00 2001 From: Video Date: Sun, 13 Nov 2022 07:01:30 -0700 Subject: [PATCH] Resolves FS-322 --- .../command/Command_potion.java | 37 ++++++------------- 1 file changed, 12 insertions(+), 25 deletions(-) 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; } }