Revert "We can't damage and kill, so we will just kill to make everyone happy, and the event pointless."

This reverts commit 705efc6002.

Also fix kill to do the same.
This commit is contained in:
KHobbits 2012-05-06 16:09:47 +01:00
parent 705efc6002
commit d3397279f6
2 changed files with 6 additions and 4 deletions

View file

@ -24,15 +24,14 @@ public class Commandkill extends EssentialsCommand
for (Player matchPlayer : server.matchPlayer(args[0]))
{
final EntityDamageEvent ede = new EntityDamageEvent(matchPlayer, sender instanceof Player && ((Player)sender).getName().equals(matchPlayer.getName()) ? EntityDamageEvent.DamageCause.SUICIDE : EntityDamageEvent.DamageCause.CUSTOM, 1000);
final EntityDamageEvent ede = new EntityDamageEvent(matchPlayer, sender instanceof Player && ((Player)sender).getName().equals(matchPlayer.getName()) ? EntityDamageEvent.DamageCause.SUICIDE : EntityDamageEvent.DamageCause.CUSTOM, Short.MAX_VALUE);
server.getPluginManager().callEvent(ede);
if (ede.isCancelled() && !sender.hasPermission("essentials.kill.force"))
{
continue;
}
matchPlayer.damage(1000);
matchPlayer.setHealth(0);
matchPlayer.damage(Short.MAX_VALUE);
sender.sendMessage(_("kill", matchPlayer.getDisplayName()));
}
}