Resolves FS-322

This commit is contained in:
Video 2022-11-13 07:01:30 -07:00
parent 22161b2e90
commit 3d67c83ea4

View File

@ -186,7 +186,7 @@ public class Command_potion extends FreedomCommand
{ {
switch (args.length) switch (args.length)
{ {
case 1: case 1 ->
{ {
List<String> arguments = new ArrayList<>(Arrays.asList("list", "clear", "add")); List<String> arguments = new ArrayList<>(Arrays.asList("list", "clear", "add"));
if (plugin.al.isAdmin(sender)) if (plugin.al.isAdmin(sender))
@ -195,56 +195,43 @@ public class Command_potion extends FreedomCommand
} }
return arguments; return arguments;
} }
case 2 ->
case 2:
{ {
if (args[0].equals("clear")) if (args[0].equalsIgnoreCase("clear"))
{ {
if (plugin.al.isAdmin(sender)) if (plugin.al.isAdmin(sender))
{ {
return FUtil.getPlayerList(); return FUtil.getPlayerList();
} }
} }
else if (args[0].equals("add")) else if (args[0].equalsIgnoreCase("add"))
{ {
return getAllPotionTypes(); return getAllPotionTypes();
} }
break;
} }
case 3 ->
case 3:
{ {
if (args[0].equals("add")) if (args[0].equalsIgnoreCase("add"))
{ {
return Collections.singletonList("<duration>"); return Collections.singletonList("<duration>");
} }
break;
} }
case 4 ->
case 4:
{ {
if (args[0].equals("add")) if (args[0].equalsIgnoreCase("add"))
{ {
return Collections.singletonList("<amplifier>"); return Collections.singletonList("<amplifier>");
} }
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;
} }
} }