From eadbc504e5c2a309fc1388c434e51b8e9845b674 Mon Sep 17 00:00:00 2001 From: Video Date: Sun, 13 Nov 2022 06:35:44 -0700 Subject: [PATCH] Resolves FS-337 --- .../totalfreedommod/command/Command_deop.java | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_deop.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_deop.java index 1cdddbe6..ed61c69f 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_deop.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_deop.java @@ -32,16 +32,14 @@ public class Command_deop extends FreedomCommand final List matchedPlayerNames = new ArrayList<>(); for (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(false); - msg(player, YOU_ARE_NOT_OP); - plugin.rm.updateDisplay(player); - } + matchedPlayerNames.add(player.getName()); + player.setOp(false); + msg(player, YOU_ARE_NOT_OP); + plugin.rm.updateDisplay(player); } }