Fix tp permissions check to check player typing command not teleportee.

If you don't want players inviting players to other worlds, do not give them essentials.world.<currentworld>
This commit is contained in:
KHobbits 2012-08-08 22:50:54 +01:00
parent 8e50158af8
commit dd12e5db66
5 changed files with 5 additions and 5 deletions

View File

@ -58,7 +58,7 @@ public class Commandtp extends EssentialsCommand
throw new Exception(_("teleportDisabled", toPlayer.getDisplayName())); throw new Exception(_("teleportDisabled", toPlayer.getDisplayName()));
} }
if (target.getWorld() != toPlayer.getWorld() && ess.getSettings().isWorldTeleportPermissions() if (target.getWorld() != toPlayer.getWorld() && ess.getSettings().isWorldTeleportPermissions()
&& !target.isAuthorized("essentials.world." + toPlayer.getWorld().getName())) && !user.isAuthorized("essentials.world." + toPlayer.getWorld().getName()))
{ {
throw new Exception(_("noPerm", "essentials.world." + toPlayer.getWorld().getName())); throw new Exception(_("noPerm", "essentials.world." + toPlayer.getWorld().getName()));
} }

View File

@ -26,7 +26,7 @@ public class Commandtpahere extends EssentialsCommand
throw new Exception(_("teleportDisabled", player.getDisplayName())); throw new Exception(_("teleportDisabled", player.getDisplayName()));
} }
if (user.getWorld() != player.getWorld() && ess.getSettings().isWorldTeleportPermissions() if (user.getWorld() != player.getWorld() && ess.getSettings().isWorldTeleportPermissions()
&& !player.isAuthorized("essentials.world." + user.getWorld().getName())) && !user.isAuthorized("essentials.world." + user.getWorld().getName()))
{ {
throw new Exception(_("noPerm", "essentials.world." + user.getWorld().getName())); throw new Exception(_("noPerm", "essentials.world." + user.getWorld().getName()));
} }

View File

@ -43,7 +43,7 @@ public class Commandtpall extends EssentialsCommand
continue; continue;
} }
if (user.getWorld() != player.getWorld() && ess.getSettings().isWorldTeleportPermissions() if (user.getWorld() != player.getWorld() && ess.getSettings().isWorldTeleportPermissions()
&& !player.isAuthorized("essentials.world." + user.getWorld().getName())) && !user.isAuthorized("essentials.world." + user.getWorld().getName()))
{ {
continue; continue;
} }

View File

@ -23,7 +23,7 @@ public class Commandtphere extends EssentialsCommand
throw new Exception(_("teleportDisabled", player.getDisplayName())); throw new Exception(_("teleportDisabled", player.getDisplayName()));
} }
if (user.getWorld() != player.getWorld() && ess.getSettings().isWorldTeleportPermissions() if (user.getWorld() != player.getWorld() && ess.getSettings().isWorldTeleportPermissions()
&& !player.isAuthorized("essentials.world." + user.getWorld().getName())) && !user.isAuthorized("essentials.world." + user.getWorld().getName()))
{ {
throw new Exception(_("noPerm", "essentials.world." + user.getWorld().getName())); throw new Exception(_("noPerm", "essentials.world." + user.getWorld().getName()));
} }

View File

@ -31,7 +31,7 @@ public class Commandtpohere extends EssentialsCommand
} }
if (user.getWorld() != player.getWorld() && ess.getSettings().isWorldTeleportPermissions() if (user.getWorld() != player.getWorld() && ess.getSettings().isWorldTeleportPermissions()
&& !player.isAuthorized("essentials.world." + user.getWorld().getName())) && !user.isAuthorized("essentials.world." + user.getWorld().getName()))
{ {
throw new Exception(_("noPerm", "essentials.world." + user.getWorld().getName())); throw new Exception(_("noPerm", "essentials.world." + user.getWorld().getName()));
} }