Resolves FS-341

This commit is contained in:
Video 2022-11-13 06:25:56 -07:00 committed by Paul Reilly
parent 1937a3d4de
commit 63f805935f

View File

@ -33,10 +33,9 @@ public class Command_op extends FreedomCommand
List<String> matchedPlayerNames = new ArrayList<>(); List<String> matchedPlayerNames = new ArrayList<>();
for (final Player player : server.getOnlinePlayers()) for (final Player player : server.getOnlinePlayers())
{ {
if (player.getName().toLowerCase().contains(targetName) || player.getDisplayName().toLowerCase().contains(targetName) if ((player.getName().toLowerCase().contains(targetName) || player.getDisplayName().toLowerCase().contains(targetName)
|| player.getName().contains(targetName) || player.getDisplayName().contains(targetName)) || player.getName().contains(targetName) || player.getDisplayName().contains(targetName)) &&
{ !player.isOp() && !plugin.al.isVanished(player.getName()))
if (!player.isOp() && !plugin.al.isVanished(player.getName()))
{ {
matchedPlayerNames.add(player.getName()); matchedPlayerNames.add(player.getName());
player.setOp(true); player.setOp(true);
@ -44,7 +43,6 @@ public class Command_op extends FreedomCommand
plugin.rm.updateDisplay(player); plugin.rm.updateDisplay(player);
} }
} }
}
if (!matchedPlayerNames.isEmpty()) if (!matchedPlayerNames.isEmpty())
{ {