mirror of
https://github.com/essentials/Essentials.git
synced 2025-08-18 12:31:26 +02:00
update tptoggle to allow toggling other players :: new permission: essentials.tptoggle.others
This commit is contained in:
@@ -14,9 +14,27 @@ public class Commandtptoggle extends EssentialsCommand
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
|
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()
|
user.sendMessage(user.toggleTeleportEnabled()
|
||||||
? _("teleportationEnabled")
|
? _("teleportationEnabled")
|
||||||
: _("teleportationDisabled"));
|
: _("teleportationDisabled"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user