mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-08-03 19:15:44 +00:00
update tptoggle to allow toggling other players :: new permission: essentials.tptoggle.others
This commit is contained in:
parent
8b660d32ac
commit
fbb3d7344f
1 changed files with 18 additions and 0 deletions
|
@ -15,8 +15,26 @@ public class Commandtptoggle extends EssentialsCommand
|
|||
@Override
|
||||
public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
|
||||
{
|
||||
User otherUser = null;
|
||||
if (args.length > 0 && user.isAuthorized("essentials.tptoggle.others"))
|
||||
{
|
||||
otherUser = ess.getUser(server.getPlayer(args[0]));
|
||||
if (otherUser == null)
|
||||
{
|
||||
throw new Exception(_("playerNotFound"));
|
||||
}
|
||||
else
|
||||
{
|
||||
ess.getUser(server.getPlayer(args[0])).sendMessage(user.toggleTeleportEnabled()
|
||||
? _("teleportationEnabled")
|
||||
: _("teleportationDisabled"));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
user.sendMessage(user.toggleTeleportEnabled()
|
||||
? _("teleportationEnabled")
|
||||
: _("teleportationDisabled"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue