mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-01-27 10:31:31 +01:00
Adding world permission checks to:
tpaall tpall tpahere tphere tpohere User is required to have the permission for the world he is in, before he can teleport users outside this world, to it.
This commit is contained in:
parent
5d45495371
commit
97eed50ccc
@ -45,6 +45,11 @@ public class Commandtpaall extends EssentialsCommand
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (user.getWorld() != player.getWorld() && ess.getSettings().isWorldTeleportPermissions()
|
||||
&& !user.isAuthorized("essentials.world." + user.getWorld().getName()))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
try
|
||||
{
|
||||
player.requestTeleport(user, true);
|
||||
|
@ -25,12 +25,14 @@ public class Commandtpaccept extends EssentialsCommand
|
||||
throw new Exception(_("noPendingRequest"));
|
||||
}
|
||||
|
||||
if (user.isTpRequestHere() && !target.isAuthorized("essentials.tpahere"))
|
||||
if (user.isTpRequestHere() && ((!target.isAuthorized("essentials.tpahere") && !target.isAuthorized("essentials.tpaall"))
|
||||
|| (user.getWorld() != target.getWorld() && ess.getSettings().isWorldTeleportPermissions()
|
||||
&& !user.isAuthorized("essentials.world." + user.getWorld().getName()))))
|
||||
{
|
||||
throw new Exception(_("noPendingRequest"));
|
||||
}
|
||||
|
||||
if (!user.isTpRequestHere() && ((!target.isAuthorized("essentials.tpa") && !target.isAuthorized("essentials.tpaall"))
|
||||
if (!user.isTpRequestHere() && (!target.isAuthorized("essentials.tpa")
|
||||
|| (user.getWorld() != target.getWorld() && ess.getSettings().isWorldTeleportPermissions()
|
||||
&& !user.isAuthorized("essentials.world." + target.getWorld().getName()))))
|
||||
{
|
||||
|
@ -25,6 +25,11 @@ public class Commandtpahere extends EssentialsCommand
|
||||
{
|
||||
throw new Exception(_("teleportDisabled", player.getDisplayName()));
|
||||
}
|
||||
if (user.getWorld() != player.getWorld() && ess.getSettings().isWorldTeleportPermissions()
|
||||
&& !user.isAuthorized("essentials.world." + user.getWorld().getName()))
|
||||
{
|
||||
throw new Exception(_("noPerm", "essentials.world." + user.getWorld().getName()));
|
||||
}
|
||||
player.requestTeleport(user, true);
|
||||
player.sendMessage(_("teleportHereRequest", user.getDisplayName()));
|
||||
player.sendMessage(_("typeTpaccept"));
|
||||
|
@ -42,6 +42,11 @@ public class Commandtpall extends EssentialsCommand
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (user.getWorld() != player.getWorld() && ess.getSettings().isWorldTeleportPermissions()
|
||||
&& !user.isAuthorized("essentials.world." + user.getWorld().getName()))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
try
|
||||
{
|
||||
player.getTeleport().now(user, false, TeleportCause.COMMAND);
|
||||
|
@ -22,6 +22,11 @@ public class Commandtphere extends EssentialsCommand
|
||||
{
|
||||
throw new Exception(_("teleportDisabled", player.getDisplayName()));
|
||||
}
|
||||
if (user.getWorld() != player.getWorld() && ess.getSettings().isWorldTeleportPermissions()
|
||||
&& !user.isAuthorized("essentials.world." + user.getWorld().getName()))
|
||||
{
|
||||
throw new Exception(_("noPerm", "essentials.world." + user.getWorld().getName()));
|
||||
}
|
||||
player.getTeleport().teleport(user, new Trade(this.getName(), ess), TeleportCause.COMMAND);
|
||||
user.sendMessage(_("teleporting"));
|
||||
player.sendMessage(_("teleporting"));
|
||||
|
@ -30,6 +30,12 @@ public class Commandtpohere extends EssentialsCommand
|
||||
throw new NoSuchFieldException(_("playerNotFound"));
|
||||
}
|
||||
|
||||
if (user.getWorld() != player.getWorld() && ess.getSettings().isWorldTeleportPermissions()
|
||||
&& !user.isAuthorized("essentials.world." + user.getWorld().getName()))
|
||||
{
|
||||
throw new Exception(_("noPerm", "essentials.world." + user.getWorld().getName()));
|
||||
}
|
||||
|
||||
// Verify permission
|
||||
if (!player.isHidden() || user.isAuthorized("essentials.teleport.hidden"))
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user