From 2a1ff28af2b054a4449d2af8fc378ba7e8a110e8 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Thu, 30 Dec 2010 04:40:57 -0800 Subject: [PATCH] Fixed ezModo, for reals this time. --- vMinecraftListener.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/vMinecraftListener.java b/vMinecraftListener.java index 613fd8f74..e122b7b60 100644 --- a/vMinecraftListener.java +++ b/vMinecraftListener.java @@ -86,10 +86,7 @@ public class vMinecraftListener extends PluginListener { //Use: Checks for exploits and runs the commands //===================================================================== public boolean onHealthChange(Player player,int oldValue,int newValue){ - //Invincibility for EzModo players - if(vMinecraftSettings.getInstance().isEzModo(player.getName())){ - return false; - } + //Sets a player as dead if (player.getHealth() < 1){ vMinecraftUsers.getProfile(player).isDead(true); @@ -161,8 +158,14 @@ public class vMinecraftListener extends PluginListener { return false; } - public boolean onDamage(PluginLoader.DamageType type, BaseEntity attacker, BaseEntity defender, int amount) { - + public boolean onDamage(PluginLoader.DamageType type, BaseEntity attacker, BaseEntity defender, int amount) { + //Invincibility for EzModo players + if(defender.isPlayer()){ + Player dplayer = defender.getPlayer(); + if(vMinecraftSettings.getInstance().isEzModo(dplayer.getName())){ + return true; + } + } return false; } } \ No newline at end of file