Implement permission node to extinguish other players (#2826)

Implements a specific permission node to restrict access to extinguishing other players, so Extinguish command will match other commands with similar functionality (i.e. /feed)

Fixes #2796
This commit is contained in:
Alexander Meech 2020-05-11 12:40:24 -04:00 committed by GitHub
parent 8e3c1aaa96
commit a3a50e9cd5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -27,13 +27,13 @@ public class Commandext extends EssentialsLoopCommand {
@Override
public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception {
if (args.length < 1) {
extPlayer(user.getBase());
user.sendMessage(tl("extinguish"));
if (args.length > 0 && user.isAuthorized("essentials.ext.others")) {
loopOnlinePlayers(server, user.getSource(), true, true, args[0], null);
return;
}
loopOnlinePlayers(server, user.getSource(), true, true, args[0], null);
extPlayer(user.getBase());
user.sendMessage(tl("extinguish"));
}
@Override