checks if a player is OP before opping them

response to
338fc81b7f (r533706741)
This commit is contained in:
Elmon11 2020-12-01 23:44:00 +01:00 committed by GitHub
parent c0a7ee1bb6
commit 03a6f18d18
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17,10 +17,13 @@ public class Command_opall extends FreedomCommand
FUtil.staffAction(sender.getName(), "Opping all players on the server", false); FUtil.staffAction(sender.getName(), "Opping all players on the server", false);
for (Player player : server.getOnlinePlayers()) for (Player player : server.getOnlinePlayers())
{
if (player.isOp())
{ {
player.setOp(true); player.setOp(true);
player.sendMessage(FreedomCommand.YOU_ARE_OP); player.sendMessage(FreedomCommand.YOU_ARE_OP);
} }
}
return true; return true;
} }