Add check in GamePlayerManager so /spec can't be used on vanished staff

This commit is contained in:
ArcticZeroo 2017-10-24 17:40:11 -04:00 committed by Alexander Meech
parent 0ad46efe12
commit 8000c79f5d
2 changed files with 9 additions and 0 deletions

View File

@ -332,6 +332,10 @@ public class UtilPlayer
UtilPlayerBase.message(client, message, wiki);
}
public static void messageSearchOnlineResult(Player caller, String player, int matchCount) {
UtilPlayerBase.messageSearchOnlineResult(caller, player, matchCount);
}
public static Player searchExact(String name)
{
for (Player cur : UtilServer.getPlayers())

View File

@ -381,6 +381,11 @@ public class GamePlayerManager implements Listener
Player target = UtilPlayer.searchOnline(player, tokens[1], true);
if (target != null)
{
if (Manager.isVanished(player)) {
UtilPlayer.messageSearchOnlineResult(player, tokens[1], 0);
return;
}
UtilPlayer.message(player, F.main("Game", "You teleported to " + F.name(target.getName()) + "."));
player.teleport(target);
}