Don't hurt god players with lightning.

git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1516 e251c2fe-e539-e718-e476-b85c1f46cddb
This commit is contained in:
snowleo 2011-05-22 19:23:03 +00:00
parent df29d80e5d
commit 1f23740832

View File

@ -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"));