mirror of
https://hub.spigotmc.org/stash/scm/spigot/craftbukkit.git
synced 2025-08-31 22:30:15 +00: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;
|
return false;
|
||||||
} else if (this.getItem() != null) {
|
} else if (this.getItem() != null) {
|
||||||
if (!this.world.isStatic) {
|
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.b(damagesource.getEntity(), false);
|
||||||
this.setItem((ItemStack) null);
|
this.setItem((ItemStack) null);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue