Update Commandlightning.java

This commit is contained in:
montlikadani 2019-12-31 17:51:21 +01:00 committed by GitHub
parent e7be2b68a3
commit a1719d651e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -24,10 +24,9 @@ public class Commandlightning extends EssentialsLoopCommand {
@Override @Override
public void run(final Server server, final CommandSource sender, final String commandLabel, final String[] args) throws Exception { public void run(final Server server, final CommandSource sender, final String commandLabel, final String[] args) throws Exception {
User user;
if (sender.isPlayer()) { if (sender.isPlayer()) {
user = ess.getUser(sender.getPlayer()); User user = ess.getUser(sender.getPlayer());
if ((args.length < 1 || user != null && !user.isAuthorized("essentials.lightning.others"))) { if ((args.length < 1 || !user.isAuthorized("essentials.lightning.others"))) {
user.getWorld().strikeLightning(user.getBase().getTargetBlock((Set<Material>) null, 600).getLocation()); user.getWorld().strikeLightning(user.getBase().getTargetBlock((Set<Material>) null, 600).getLocation());
return; return;
} }
@ -64,6 +63,7 @@ public class Commandlightning extends EssentialsLoopCommand {
return super.getTabCompleteOptions(server, user, commandLabel, args); return super.getTabCompleteOptions(server, user, commandLabel, args);
} }
} }
@Override @Override
protected List<String> getTabCompleteOptions(final Server server, final CommandSource sender, final String commandLabel, final String[] args) { protected List<String> getTabCompleteOptions(final Server server, final CommandSource sender, final String commandLabel, final String[] args) {
if (args.length == 1) { if (args.length == 1) {