diff --git a/Essentials/src/main/java/com/earth2me/essentials/EssentialsEntityListener.java b/Essentials/src/main/java/com/earth2me/essentials/EssentialsEntityListener.java index 1305ba91ce3..163d9165010 100644 --- a/Essentials/src/main/java/com/earth2me/essentials/EssentialsEntityListener.java +++ b/Essentials/src/main/java/com/earth2me/essentials/EssentialsEntityListener.java @@ -121,7 +121,7 @@ public void run() { @EventHandler(priority = EventPriority.LOW, ignoreCancelled = true) public void onEntityDamage(final EntityDamageEvent event) { - if (event.getEntity() instanceof Player && ess.getUser((Player) event.getEntity()).isGodModeEnabled()) { + if (event.getEntity() instanceof Player && ess.getUser((Player) event.getEntity()).isGodModeEnabled() && event.getDamage() < Float.MAX_VALUE) { final Player player = (Player) event.getEntity(); player.setFireTicks(0); player.setRemainingAir(player.getMaximumAir()); diff --git a/Essentials/src/main/java/com/earth2me/essentials/commands/Commandkill.java b/Essentials/src/main/java/com/earth2me/essentials/commands/Commandkill.java index d2a76cbfade..a88010f750b 100644 --- a/Essentials/src/main/java/com/earth2me/essentials/commands/Commandkill.java +++ b/Essentials/src/main/java/com/earth2me/essentials/commands/Commandkill.java @@ -4,7 +4,6 @@ import com.earth2me.essentials.User; import org.bukkit.Server; import org.bukkit.entity.Player; -import org.bukkit.event.entity.EntityDamageEvent; import java.util.Collections; import java.util.List; @@ -29,12 +28,7 @@ protected void updatePlayer(final Server server, final CommandSource sender, fin if (sender.isPlayer() && user.isAuthorized("essentials.kill.exempt") && !ess.getUser(sender.getPlayer()).isAuthorized("essentials.kill.force")) { throw new PlayerExemptException("killExempt", matchPlayer.getDisplayName()); } - final EntityDamageEvent ede = ess.getDamageEventProvider().callDamageEvent(matchPlayer, sender.isPlayer() && sender.getPlayer().getName().equals(matchPlayer.getName()) ? EntityDamageEvent.DamageCause.SUICIDE : EntityDamageEvent.DamageCause.CUSTOM, Float.MAX_VALUE); - if (ede.isCancelled() && sender.isPlayer() && !ess.getUser(sender.getPlayer()).isAuthorized("essentials.kill.force")) { - return; - } - ede.getEntity().setLastDamageCause(ede); - matchPlayer.setHealth(0); + matchPlayer.damage(Float.MAX_VALUE); sender.sendTl("kill", matchPlayer.getDisplayName()); }