From a1719d651e5ade7911d9475dad91cbc34ac0ac37 Mon Sep 17 00:00:00 2001 From: montlikadani Date: Tue, 31 Dec 2019 17:51:21 +0100 Subject: [PATCH] Update Commandlightning.java --- .../com/earth2me/essentials/commands/Commandlightning.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandlightning.java b/Essentials/src/com/earth2me/essentials/commands/Commandlightning.java index 1b479d0fc..271522113 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandlightning.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandlightning.java @@ -24,10 +24,9 @@ public class Commandlightning extends EssentialsLoopCommand { @Override public void run(final Server server, final CommandSource sender, final String commandLabel, final String[] args) throws Exception { - User user; if (sender.isPlayer()) { - user = ess.getUser(sender.getPlayer()); - if ((args.length < 1 || user != null && !user.isAuthorized("essentials.lightning.others"))) { + User user = ess.getUser(sender.getPlayer()); + if ((args.length < 1 || !user.isAuthorized("essentials.lightning.others"))) { user.getWorld().strikeLightning(user.getBase().getTargetBlock((Set) null, 600).getLocation()); return; } @@ -64,6 +63,7 @@ public class Commandlightning extends EssentialsLoopCommand { return super.getTabCompleteOptions(server, user, commandLabel, args); } } + @Override protected List getTabCompleteOptions(final Server server, final CommandSource sender, final String commandLabel, final String[] args) { if (args.length == 1) {