diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtp.java b/Essentials/src/com/earth2me/essentials/commands/Commandtp.java index 72739966b..05451fdcf 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtp.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtp.java @@ -49,6 +49,11 @@ public class Commandtp extends EssentialsCommand user.sendMessage(_("teleporting")); final User target = getPlayer(server, args, 0); final User toPlayer = getPlayer(server, args, 1); + if (target.getWorld() != toPlayer.getWorld() && ess.getSettings().getIsWorldTeleportPermissions() + && !user.isAuthorized("essentials.world." + toPlayer.getWorld().getName())) + { + throw new Exception(_("noPerm", "essentials.world." + toPlayer.getWorld().getName())); + } target.getTeleport().now(toPlayer, false, TeleportCause.COMMAND); target.sendMessage(_("teleportAtoB", user.getDisplayName(), toPlayer.getDisplayName())); break; diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtpa.java b/Essentials/src/com/earth2me/essentials/commands/Commandtpa.java index 97fa15d5c..90e8e69d9 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtpa.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpa.java @@ -25,6 +25,11 @@ public class Commandtpa extends EssentialsCommand { throw new Exception(_("teleportDisabled", player.getDisplayName())); } + if (user.getWorld() != player.getWorld() && ess.getSettings().getIsWorldTeleportPermissions() + && !user.isAuthorized("essentials.world." + player.getWorld().getName())) + { + throw new Exception(_("noPerm", "essentials.world." + player.getWorld().getName())); + } if (!player.isIgnoredPlayer(user.getName())) { player.requestTeleport(user, false); @@ -36,11 +41,6 @@ public class Commandtpa extends EssentialsCommand player.sendMessage(_("teleportRequestTimeoutInfo", ess.getSettings().getTpaAcceptCancellation())); } } - if (user.getWorld() != player.getWorld() && ess.getSettings().getIsWorldTeleportPermissions() - && !user.isAuthorized("essentials.world." + player.getWorld().getName())) - { - throw new Exception(_("noPerm", "essentials.world." + player.getWorld().getName())); - } user.sendMessage(_("requestSent", player.getDisplayName())); } }