From aa3cb69fe852eeaaf8c84dd965c059033e155f93 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Thu, 2 Dec 2010 19:03:54 -0800 Subject: [PATCH] Revisions to how onDamage works --- vMinecraftListener.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/vMinecraftListener.java b/vMinecraftListener.java index 78c4e47e2..e96c0ed67 100644 --- a/vMinecraftListener.java +++ b/vMinecraftListener.java @@ -109,6 +109,9 @@ public class vMinecraftListener extends PluginListener { vMinecraftUsers.addUser(player); } public boolean onDamage(PluginLoader.DamageType type, BaseEntity attacker, BaseEntity defender, int amount) { + Player player; + for(Player p : etc.getServer().getPlayerList()){ + if (p.getId() == defender.getId() && p.getHealth() < 1){ if(type == type.CREEPER_EXPLOSION){ damagetype = 1; //Creeper } else if(type == type.FALL){ @@ -122,6 +125,8 @@ public class vMinecraftListener extends PluginListener { } else if (type == type.WATER){ damagetype = 6; //Water } + } + } return false; }