From 4363ae55e0a5c15a501d3dfeee0c0713202ad66b Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Wed, 8 Feb 2012 16:14:33 -0600 Subject: [PATCH] [Bleeding] setLastDamageCaused to ComplexEntityPart parent. By: Feildmaster --- .../java/org/bukkit/event/entity/EntityDamageEvent.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/paper-api/src/main/java/org/bukkit/event/entity/EntityDamageEvent.java b/paper-api/src/main/java/org/bukkit/event/entity/EntityDamageEvent.java index 5c10c02e60..d40f44895d 100644 --- a/paper-api/src/main/java/org/bukkit/event/entity/EntityDamageEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/entity/EntityDamageEvent.java @@ -1,5 +1,6 @@ package org.bukkit.event.entity; +import org.bukkit.entity.ComplexEntityPart; import org.bukkit.entity.Entity; import org.bukkit.event.Cancellable; import org.bukkit.event.Event; @@ -25,7 +26,11 @@ public class EntityDamageEvent extends EntityEvent implements Cancellable { this.cause = cause; this.damage = damage; - damagee.setLastDamageCause(this); + if (damagee instanceof ComplexEntityPart) { + ((ComplexEntityPart) damagee).getParent().setLastDamageCause(this); + } else { + damagee.setLastDamageCause(this); + } } public boolean isCancelled() {