Respect hidden players in f show. Resolves #1049

This commit is contained in:
Trent Hensler 2018-03-04 12:53:52 -08:00
parent d6b147ef7b
commit fe51837845

View File

@ -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;