diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtp.java b/Essentials/src/com/earth2me/essentials/commands/Commandtp.java index 714a634d4..e33aed22c 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtp.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtp.java @@ -30,6 +30,10 @@ public class Commandtp extends EssentialsCommand { case 1: final User player = getPlayer(server, user, args, 0, false, true); + if (getTFMHandler().isVanished(player) && !getTFMHandler().isAdmin(user)) { + throw new PlayerNotFoundException(); + } + if (!player.isTeleportEnabled()) { throw new Exception(tl("teleportDisabled", player.getDisplayName())); } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtpa.java b/Essentials/src/com/earth2me/essentials/commands/Commandtpa.java index 7cfb84633..529373933 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtpa.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpa.java @@ -29,6 +29,9 @@ public class Commandtpa extends EssentialsCommand { if (user.getName().equalsIgnoreCase(player.getName())) { throw new NotEnoughArgumentsException(); } + if (getTFMHandler().isVanished(player) && !getTFMHandler().isAdmin(user)) { + throw new PlayerNotFoundException(); + } if (!player.isAuthorized("essentials.tpaccept")) { throw new Exception(tl("teleportNoAcceptPermission", player.getDisplayName())); } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtpahere.java b/Essentials/src/com/earth2me/essentials/commands/Commandtpahere.java index 98584f075..44e74a8f5 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtpahere.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpahere.java @@ -25,6 +25,9 @@ public class Commandtpahere extends EssentialsCommand { if (user.getName().equalsIgnoreCase(player.getName())) { throw new NotEnoughArgumentsException(); } + if (getTFMHandler().isVanished(player) && !getTFMHandler().isAdmin(user)) { + throw new PlayerNotFoundException(); + } if (!player.isTeleportEnabled()) { throw new Exception(tl("teleportDisabled", player.getDisplayName())); } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtphere.java b/Essentials/src/com/earth2me/essentials/commands/Commandtphere.java index 138729589..540da3a1c 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtphere.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtphere.java @@ -19,6 +19,9 @@ public class Commandtphere extends EssentialsCommand { @Override public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception { final User player = getPlayer(server, user, args, 0); + if (getTFMHandler().isVanished(player) && !getTFMHandler().isAdmin(user)) { + throw new PlayerNotFoundException(); + } if (!player.isTeleportEnabled()) { throw new Exception(tl("teleportDisabled", player.getDisplayName())); } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtppos.java b/Essentials/src/com/earth2me/essentials/commands/Commandtppos.java index ff6de7d15..ef5a79f85 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtppos.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtppos.java @@ -65,6 +65,9 @@ public class Commandtppos extends EssentialsCommand { } User user = getPlayer(server, args, 0, true, false); + if (getTFMHandler().isVanished(user) && !getTFMHandler().isAdmin(sender.getSender())) { + throw new PlayerNotFoundException(); + } final double x = args[1].startsWith("~") ? user.getLocation().getX() + (args[1].length() > 1 ? Integer.parseInt(args[1].substring(1)) : 0) : Integer.parseInt(args[1]); final double y = args[2].startsWith("~") ? user.getLocation().getY() + (args[2].length() > 1 ? Integer.parseInt(args[2].substring(1)) : 0) : Integer.parseInt(args[2]); final double z = args[3].startsWith("~") ? user.getLocation().getZ() + (args[3].length() > 1 ? Integer.parseInt(args[3].substring(1)) : 0) : Integer.parseInt(args[3]);