mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-20 23:46:57 +01:00
Call EntityDamageEvent on ItemFrame item removal. Fixes BUKKIT-5020
Calling this event allows plugins to react to the situation by simply handling a normal damage event, possibly using existing code to handle other entity damage. Pulled from PR #1279
This commit is contained in:
parent
3cf569a33f
commit
36ef37b982
1 changed files with 5 additions and 0 deletions
|
@ -23,6 +23,11 @@ public class EntityItemFrame extends EntityHanging {
|
|||
return false;
|
||||
} else if (this.getItem() != null) {
|
||||
if (!this.world.isStatic) {
|
||||
// CraftBukkit start
|
||||
if (org.bukkit.craftbukkit.event.CraftEventFactory.handleEntityDamageEvent(this, damagesource, f).isCancelled() || this.dead) {
|
||||
return false;
|
||||
}
|
||||
// CraftBukkit end
|
||||
this.b(damagesource.getEntity(), false);
|
||||
this.setItem((ItemStack) null);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue