From 1f2374083297fb597c41de1bf2d04fc57a36c8cd Mon Sep 17 00:00:00 2001 From: snowleo Date: Sun, 22 May 2011 19:23:03 +0000 Subject: [PATCH] Don't hurt god players with lightning. git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1516 e251c2fe-e539-e718-e476-b85c1f46cddb --- .../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 794fd81f1..c9135d61e 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandlightning.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandlightning.java @@ -1,10 +1,8 @@ package com.earth2me.essentials.commands; -import com.earth2me.essentials.Essentials; import com.earth2me.essentials.User; import com.earth2me.essentials.Util; import org.bukkit.Server; -import org.bukkit.World; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; @@ -46,7 +44,9 @@ public class Commandlightning extends EssentialsCommand { sender.sendMessage(Util.format("lightningUse", p.getDisplayName())); p.getWorld().strikeLightning(p.getLocation()); - p.setHealth(p.getHealth() < 5 ? 0 : p.getHealth() - 5); + if (!ess.getUser(p).isGodModeEnabled()) { + p.setHealth(p.getHealth() < 5 ? 0 : p.getHealth() - 5); + } if (ess.getSettings().warnOnSmite()) { p.sendMessage(Util.i18n("lightningSmited"));