From 76d8016b32fb747e82750597cf3efc69deed169c Mon Sep 17 00:00:00 2001 From: Andrew Ardill Date: Mon, 28 Feb 2011 17:43:56 +1100 Subject: [PATCH] BUGFIX: Damage events should be using getDamage() to set damage. --- src/main/java/net/minecraft/server/EntityHuman.java | 2 ++ src/main/java/net/minecraft/server/EntityLiving.java | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java index c509e60034..aa7e96fd05 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java @@ -370,6 +370,8 @@ public abstract class EntityHuman extends EntityLiving { if (event.isCancelled()) { return false; } + + i = event.getDamage(); } // CraftBukkit end diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java index e021be0d81..b79d6b911d 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -124,12 +124,13 @@ public abstract class EntityLiving extends Entity { CraftServer server = ((WorldServer) this.world).getServer(); org.bukkit.entity.Entity victim = this.getBukkitEntity(); DamageCause damageType = EntityDamageEvent.DamageCause.SUFFOCATION; + int damage = 1; - EntityDamageEvent event = new EntityDamageEvent(victim, damageType, 1); + EntityDamageEvent event = new EntityDamageEvent(victim, damageType, damage); server.getPluginManager().callEvent(event); if (!event.isCancelled()) { - this.a((Entity) null, 1); + this.a((Entity) null, event.getDamage()); } // CraftBukkit end }