New permission: essentials.tp.others - Allows players to /tp <p1> <p2> replaces old reused permission.

New permission usage: if world-teleport-permissions is true in the config, TP commands will now check for essentials.world.<worldname> when a tp would switch worlds.
This commit is contained in:
KHobbits 2012-03-17 06:08:06 +00:00
parent e4ce814c2f
commit 762105d692
12 changed files with 20 additions and 16 deletions

View file

@ -30,6 +30,11 @@ public class Commandtp 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()));
}
user.sendMessage(_("teleporting"));
final Trade charge = new Trade(this.getName(), ess);
charge.isAffordableFor(user);
@ -37,9 +42,9 @@ public class Commandtp extends EssentialsCommand
throw new NoChargeException();
default:
if (!user.isAuthorized("essentials.tpohere"))
if (!user.isAuthorized("essentials.tp.others"))
{
throw new Exception(_("needTpohere"));
throw new Exception(_("noPerm", "essentials.tp.others"));
}
user.sendMessage(_("teleporting"));
final User target = getPlayer(server, args, 0);