mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-08-06 20:43:11 +00:00
Make /home and /back obey the world perm system.
This will prevent players from moving between words using virtually all essentials commands. ATM /warp is excepted, because we already have per warp permissions. Ess3 may see warp permissions altered to: essentials.warp.<world>.<warpname>
This commit is contained in:
parent
1c0838aa5d
commit
faa3a5e027
3 changed files with 19 additions and 3 deletions
|
@ -54,7 +54,7 @@ public class Commandhome extends EssentialsCommand
|
|||
throw new NoChargeException();
|
||||
}
|
||||
}
|
||||
user.getTeleport().home(player, homeName.toLowerCase(Locale.ENGLISH), charge);
|
||||
goHome(user, player, homeName.toLowerCase(Locale.ENGLISH), charge);
|
||||
}
|
||||
catch (NotEnoughArgumentsException e)
|
||||
{
|
||||
|
@ -80,7 +80,7 @@ public class Commandhome extends EssentialsCommand
|
|||
}
|
||||
else if (homes.size() == 1 && player.equals(user))
|
||||
{
|
||||
user.getTeleport().home(player, homes.get(0), charge);
|
||||
goHome(user, player, homes.get(0), charge);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -93,4 +93,14 @@ public class Commandhome extends EssentialsCommand
|
|||
}
|
||||
throw new NoChargeException();
|
||||
}
|
||||
|
||||
private void goHome(final User user, final User player, final String home, final Trade charge) throws Exception
|
||||
{
|
||||
if (user.getWorld() != player.getHome(home).getWorld() && ess.getSettings().isWorldTeleportPermissions()
|
||||
&& !user.isAuthorized("essentials.world." + player.getHome(home).getWorld().getName()))
|
||||
{
|
||||
throw new Exception(_("noPerm", "essentials.world." + player.getHome(home).getWorld().getName()));
|
||||
}
|
||||
user.getTeleport().home(player, home, charge);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue