From fe51837845c28cc14872b70760f8cf2413f10804 Mon Sep 17 00:00:00 2001 From: Trent Hensler Date: Sun, 4 Mar 2018 12:53:52 -0800 Subject: [PATCH] Respect hidden players in f show. Resolves #1049 --- .../java/com/massivecraft/factions/zcore/util/TagUtil.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/massivecraft/factions/zcore/util/TagUtil.java b/src/main/java/com/massivecraft/factions/zcore/util/TagUtil.java index 4bf18fbf..441eee90 100644 --- a/src/main/java/com/massivecraft/factions/zcore/util/TagUtil.java +++ b/src/main/java/com/massivecraft/factions/zcore/util/TagUtil.java @@ -200,6 +200,9 @@ public class TagUtil { FancyMessage currentOnline = P.p.txt.parseFancy(prefix); boolean firstOnline = true; for (FPlayer p : MiscUtil.rankOrder(target.getFPlayersWhereOnline(true))) { + if (fme.getPlayer() != null && !fme.getPlayer().canSee(p.getPlayer())) { + continue; // skip + } String name = p.getNameAndTitle(); currentOnline.then(firstOnline ? name : ", " + name); currentOnline.tooltip(tipPlayer(p)).color(fme.getColorTo(p)); @@ -216,7 +219,8 @@ public class TagUtil { boolean firstOffline = true; for (FPlayer p : MiscUtil.rankOrder(target.getFPlayers())) { String name = p.getNameAndTitle(); - if (!p.isOnline()) { + // Also make sure to add players that are online BUT can't be seen. + if (!p.isOnline() || (fme.getPlayer() != null && p.isOnline() && !fme.getPlayer().canSee(p.getPlayer()))) { currentOffline.then(firstOffline ? name : ", " + name); currentOffline.tooltip(tipPlayer(p)).color(fme.getColorTo(p)); firstOffline = false;