From 41c9feb13e2f7a06f87ab043fea264e0b476a6bd Mon Sep 17 00:00:00 2001 From: nossr50 Date: Thu, 2 Dec 2010 18:13:19 -0800 Subject: [PATCH] Fixed onDamage to report damagetypes to a public int. --- vMinecraftListener.java | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/vMinecraftListener.java b/vMinecraftListener.java index a004079e3..f15483729 100644 --- a/vMinecraftListener.java +++ b/vMinecraftListener.java @@ -6,9 +6,7 @@ import java.util.logging.Logger; //Author: nossr50, TrapAlice, cerevisiae //===================================================================== public class vMinecraftListener extends PluginListener { - public int bAttacker; - public int bDefender; - public int bAmount; + public int damagetype; protected static final Logger log = Logger.getLogger("Minecraft"); //===================================================================== @@ -96,11 +94,20 @@ public class vMinecraftListener extends PluginListener { vMinecraftUsers.addUser(player); } public boolean onDamage(PluginLoader.DamageType type, BaseEntity attacker, BaseEntity defender, int amount) { - bAttacker = attacker.getId(); - bDefender = defender.getId(); - bAmount = amount; - log.log(Level.INFO, "Attacker ID: " + bAttacker + ", Defender ID: " + bDefender + ", Amount: " + bAmount); - return false; + if(type == type.CREEPER_EXPLOSION){ + damagetype = 1; //Creeper + } else if(type == type.FALL){ + damagetype = 2; //Fall + } else if(type == type.FIRE){ + damagetype = 3; //Fire going to make it share with firetick since its similar + } else if (type == type.FIRE_TICK){ + damagetype = 4; //Firetick + } else if (type == type.LAVA){ + damagetype = 5; //Lava + } else if (type == type.WATER){ + damagetype = 6; //Water + } + return false; } } \ No newline at end of file