Implementation of reworked EntityCombustEvents

Also includes some extra comments, and a refactoring of the
PaintingBreakByEntity event that is raised when lighting strikes a painting.
This commit is contained in:
Andrew Ardill
2011-11-29 18:10:05 +11:00
parent 0c88f05c0d
commit 3da00ee41a
5 changed files with 46 additions and 34 deletions

View File

@@ -245,25 +245,6 @@ public class EntityPainting extends Entity {
return true;
}
// CraftBukkit start - copy of a method in Entity except for the CraftBukkit-specific code
// TODO: Better way?
public void a(EntityWeatherStorm entityweatherstorm) {
// CraftBukkit start
PaintingBreakByEntityEvent event = new PaintingBreakByEntityEvent((Painting) this.getBukkitEntity(), entityweatherstorm.getBukkitEntity());
Bukkit.getServer().getPluginManager().callEvent(event);
if (event.isCancelled()) {
return;
}
// CraftBukkit end
++this.fireTicks;
if (this.fireTicks == 0) {
this.j(8);
}
}
// CraftBukkit end
public void b(NBTTagCompound nbttagcompound) {
nbttagcompound.a("Dir", (byte) this.a);
nbttagcompound.setString("Motive", this.e.A);