summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2012-06-10 23:00:49 +0100
committerKHobbits <rob@khobbits.co.uk>2012-06-10 23:00:49 +0100
commit13da8c3adcfa399c757d8a6170d9d0201f418efc (patch)
tree4cc2bd8c3c273d801ae1501f8badbbb2c44b9023
parenta10190df51951960932e8f89e53e3688e47d414b (diff)
downloadEssentials-13da8c3adcfa399c757d8a6170d9d0201f418efc.tar
Essentials-13da8c3adcfa399c757d8a6170d9d0201f418efc.tar.gz
Essentials-13da8c3adcfa399c757d8a6170d9d0201f418efc.tar.lz
Essentials-13da8c3adcfa399c757d8a6170d9d0201f418efc.tar.xz
Essentials-13da8c3adcfa399c757d8a6170d9d0201f418efc.zip
Fix /lightning <player> <damage> to actually deal the proper set damage (5 or 25% by default).
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandlightning.java26
1 files changed, 10 insertions, 16 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandlightning.java b/Essentials/src/com/earth2me/essentials/commands/Commandlightning.java
index 810ef0b33..5d72d0b55 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandlightning.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandlightning.java
@@ -23,11 +23,11 @@ public class Commandlightning extends EssentialsCommand
if (sender instanceof Player)
{
user = ess.getUser(((Player)sender));
- }
- if ((args.length < 1 || !user.isAuthorized("essentials.lightning.others")) & user != null)
- {
- user.getWorld().strikeLightning(user.getTargetBlock(null, 600).getLocation());
- return;
+ if ((args.length < 1 || user != null && !user.isAuthorized("essentials.lightning.others")))
+ {
+ user.getWorld().strikeLightning(user.getTargetBlock(null, 600).getLocation());
+ return;
+ }
}
if (server.matchPlayer(args[0]).isEmpty())
@@ -35,7 +35,7 @@ public class Commandlightning extends EssentialsCommand
throw new Exception(_("playerNotFound"));
}
- int power = 1;
+ int power = 5;
if (args.length > 1)
{
try
@@ -50,18 +50,12 @@ public class Commandlightning extends EssentialsCommand
for (Player matchPlayer : server.matchPlayer(args[0]))
{
sender.sendMessage(_("lightningUse", matchPlayer.getDisplayName()));
- if (power <= 0)
- {
- matchPlayer.getWorld().strikeLightningEffect(matchPlayer.getLocation());
- }
- else
- {
- LightningStrike strike = matchPlayer.getWorld().strikeLightning(matchPlayer.getLocation());
- matchPlayer.damage(power - 1, strike);
- }
+
+ final LightningStrike strike = matchPlayer.getWorld().strikeLightningEffect(matchPlayer.getLocation());
+
if (!ess.getUser(matchPlayer).isGodModeEnabled())
{
- matchPlayer.setHealth(matchPlayer.getHealth() < 5 ? 0 : matchPlayer.getHealth() - 5);
+ matchPlayer.damage(power, strike);
}
if (ess.getSettings().warnOnSmite())
{