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
@ -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…
x
Reference in New Issue
Block a user