From 63f805935f77e2d7c131a433c5e0fe2bfcb38af3 Mon Sep 17 00:00:00 2001 From: Video Date: Sun, 13 Nov 2022 06:25:56 -0700 Subject: [PATCH] Resolves FS-341 --- .../totalfreedommod/command/Command_op.java | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_op.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_op.java index ece9abba..a7585448 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_op.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_op.java @@ -33,16 +33,14 @@ public class Command_op extends FreedomCommand List matchedPlayerNames = new ArrayList<>(); for (final Player player : server.getOnlinePlayers()) { - if (player.getName().toLowerCase().contains(targetName) || player.getDisplayName().toLowerCase().contains(targetName) - || player.getName().contains(targetName) || player.getDisplayName().contains(targetName)) + if ((player.getName().toLowerCase().contains(targetName) || player.getDisplayName().toLowerCase().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()); - player.setOp(true); - msg(player, YOU_ARE_OP); - plugin.rm.updateDisplay(player); - } + matchedPlayerNames.add(player.getName()); + player.setOp(true); + msg(player, YOU_ARE_OP); + plugin.rm.updateDisplay(player); } }