/f show|who command will no longer reveal players as online if they are hidden from the viewer by the Vanish API
This commit is contained in:
parent
1defa2984b
commit
e3a7188b0d
@ -113,7 +113,7 @@ public class CmdShow extends FCommand
|
|||||||
|
|
||||||
for (FPlayer follower : admins)
|
for (FPlayer follower : admins)
|
||||||
{
|
{
|
||||||
if (follower.isOnline())
|
if (follower.isOnlineAndVisibleTo(me))
|
||||||
{
|
{
|
||||||
memberOnlineNames.add(follower.getNameAndTitle(fme));
|
memberOnlineNames.add(follower.getNameAndTitle(fme));
|
||||||
}
|
}
|
||||||
@ -125,7 +125,7 @@ public class CmdShow extends FCommand
|
|||||||
|
|
||||||
for (FPlayer follower : mods)
|
for (FPlayer follower : mods)
|
||||||
{
|
{
|
||||||
if (follower.isOnline())
|
if (follower.isOnlineAndVisibleTo(me))
|
||||||
{
|
{
|
||||||
memberOnlineNames.add(follower.getNameAndTitle(fme));
|
memberOnlineNames.add(follower.getNameAndTitle(fme));
|
||||||
}
|
}
|
||||||
@ -137,7 +137,7 @@ public class CmdShow extends FCommand
|
|||||||
|
|
||||||
for (FPlayer follower : normals)
|
for (FPlayer follower : normals)
|
||||||
{
|
{
|
||||||
if (follower.isOnline())
|
if (follower.isOnlineAndVisibleTo(me))
|
||||||
{
|
{
|
||||||
memberOnlineNames.add(follower.getNameAndTitle(fme));
|
memberOnlineNames.add(follower.getNameAndTitle(fme));
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,14 @@ public class PlayerEntity extends Entity
|
|||||||
{
|
{
|
||||||
return this.getPlayer() != null;
|
return this.getPlayer() != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// make sure target player should be able to detect that this player is online
|
||||||
|
public boolean isOnlineAndVisibleTo(Player player)
|
||||||
|
{
|
||||||
|
Player target = this.getPlayer();
|
||||||
|
return target != null && player.canSee(target);
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isOffline()
|
public boolean isOffline()
|
||||||
{
|
{
|
||||||
return ! isOnline();
|
return ! isOnline();
|
||||||
|
Loading…
Reference in New Issue
Block a user