3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-18 20:40:08 +01:00

Handle null damage events for item frames. Fixes BUKKIT-5114

Some types of damage are handled specially so do not end up returning an
event in handleEntityDamageEvent. To ensure we don't have problems with
these we need to check for them and simply ignore them, as they've been
handled already.
Dieser Commit ist enthalten in:
Travis Watkins 2013-12-09 13:40:52 -06:00
Ursprung 80935e5c2b
Commit 305e5f4f08

Datei anzeigen

@ -24,10 +24,12 @@ public class EntityItemFrame extends EntityHanging {
} else if (this.getItem() != null) { } else if (this.getItem() != null) {
if (!this.world.isStatic) { if (!this.world.isStatic) {
// CraftBukkit start // CraftBukkit start
if (org.bukkit.craftbukkit.event.CraftEventFactory.handleEntityDamageEvent(this, damagesource, f).isCancelled() || this.dead) { org.bukkit.event.entity.EntityDamageEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.handleEntityDamageEvent(this, damagesource, f);
return false; if ((event != null && event.isCancelled()) || this.dead) {
return true;
} }
// CraftBukkit end // CraftBukkit end
this.b(damagesource.getEntity(), false); this.b(damagesource.getEntity(), false);
this.setItem((ItemStack) null); this.setItem((ItemStack) null);
} }