mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-09 11:44:19 +01:00
[Bleeding] setLastDamageCaused to ComplexEntityPart parent.
By: Feildmaster <admin@feildmaster.com>
This commit is contained in:
parent
cb2fe27653
commit
4363ae55e0
1 changed files with 6 additions and 1 deletions
|
@ -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() {
|
||||
|
|
Loading…
Reference in a new issue