This commit is contained in:
Lemon 2019-08-03 01:48:12 +05:00 committed by GitHub
parent 894feaf1dc
commit 668ccda5cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -26,18 +26,15 @@ public class Command_invis extends FreedomCommand
if (args[0].equalsIgnoreCase("clear")) if (args[0].equalsIgnoreCase("clear"))
{ {
if(!plugin.al.isAdmin(sender)) if(!plugin.al.isAdmin(sender))
{
return noPerms(); return noPerms();
} else
else { {
FUtil.adminAction(sender.getName(), "Clearing all invisibility potion effects from all players", true); FUtil.adminAction(sender.getName(), "Clearing all invisibility potion effects from all players", true);
clear = true; clear = true;
} }
} }
else else
{
return false; return false;
}
} }
List<String> players = new ArrayList<String>(); List<String> players = new ArrayList<String>();
@ -61,14 +58,12 @@ public class Command_invis extends FreedomCommand
msg("There are no invisible players"); msg("There are no invisible players");
return true; return true;
} }
if (clear) if (clear)
{
msg("Cleared " + clears + " players"); msg("Cleared " + clears + " players");
}
else else
{
msg("Invisible players (" + players.size() + "): " + StringUtils.join(players, ", ")); msg("Invisible players (" + players.size() + "): " + StringUtils.join(players, ", "));
}
return true; return true;
} }
@ -76,9 +71,7 @@ public class Command_invis extends FreedomCommand
public List<String> getTabCompleteOptions(CommandSender sender, Command command, String alias, String[] args) public List<String> getTabCompleteOptions(CommandSender sender, Command command, String alias, String[] args)
{ {
if (args.length == 1 && plugin.al.isAdmin(sender)) if (args.length == 1 && plugin.al.isAdmin(sender))
{
return Arrays.asList("clear"); return Arrays.asList("clear");
}
return Collections.emptyList(); return Collections.emptyList();
} }