summaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorsunkid <sunkid@iminurnetz.com>2011-12-27 10:56:46 -0800
committerErik Broes <erikbroes@grum.nl>2011-12-27 20:21:28 +0100
commit066a95769c3905308060641cd08a25b19748b45f (patch)
treed27a1ae2cf8c3cb87ab49742b9b746fa07a32d4f /src/main
parent5adcf526abc83be8658adea02c4140b1edf401a2 (diff)
downloadcraftbukkit-066a95769c3905308060641cd08a25b19748b45f.tar
craftbukkit-066a95769c3905308060641cd08a25b19748b45f.tar.gz
craftbukkit-066a95769c3905308060641cd08a25b19748b45f.tar.lz
craftbukkit-066a95769c3905308060641cd08a25b19748b45f.tar.xz
craftbukkit-066a95769c3905308060641cd08a25b19748b45f.zip
fixed double firing of EntityDamageByEntityEvent
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/net/minecraft/server/EntityDamageSourceIndirect.java6
-rw-r--r--src/main/java/net/minecraft/server/EntityHuman.java4
2 files changed, 8 insertions, 2 deletions
diff --git a/src/main/java/net/minecraft/server/EntityDamageSourceIndirect.java b/src/main/java/net/minecraft/server/EntityDamageSourceIndirect.java
index 38daa5f6..9d5496c1 100644
--- a/src/main/java/net/minecraft/server/EntityDamageSourceIndirect.java
+++ b/src/main/java/net/minecraft/server/EntityDamageSourceIndirect.java
@@ -17,6 +17,10 @@ public class EntityDamageSourceIndirect extends EntityDamageSource {
// CraftBukkit start
String source = (this.n == null) ? "Herobrine" : this.n.ad();
return LocaleI18n.a("death." + this.m, new Object[] { entityhuman.name, source});
+ }
+
+ public Entity getProximateDamageSource() {
+ return super.getEntity();
// CraftBukkit end
}
-} \ No newline at end of file
+}
diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java
index 29297677..24221ada 100644
--- a/src/main/java/net/minecraft/server/EntityHuman.java
+++ b/src/main/java/net/minecraft/server/EntityHuman.java
@@ -587,7 +587,9 @@ public abstract class EntityHuman extends EntityLiving {
// also damage the player in this way. For example, EntitySlime.
// We handle projectiles in their individual classes!
- if (!(entity.getBukkitEntity() instanceof Projectile)) {
+ boolean isProjectile = damagesource instanceof EntityDamageSourceIndirect && ((EntityDamageSourceIndirect) damagesource).getProximateDamageSource().getBukkitEntity() instanceof Projectile;
+
+ if (!isProjectile) {
org.bukkit.entity.Entity damager = ((Entity) entity1).getBukkitEntity();
org.bukkit.entity.Entity damagee = this.getBukkitEntity();