mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-01-27 10:31:31 +01:00
Fix per world teleport permission checking.
This commit is contained in:
parent
970364886c
commit
e752538568
@ -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;
|
||||
|
@ -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()));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user