--- a/net/minecraft/world/entity/projectile/EntityLargeFireball.java +++ b/net/minecraft/world/entity/projectile/EntityLargeFireball.java @@ -11,16 +11,20 @@ import net.minecraft.world.phys.MovingObjectPosition; import net.minecraft.world.phys.MovingObjectPositionEntity; +import org.bukkit.event.entity.ExplosionPrimeEvent; // CraftBukkit + public class EntityLargeFireball extends EntityFireballFireball { public int yield = 1; public EntityLargeFireball(EntityTypes entitytypes, World world) { super(entitytypes, world); + isIncendiary = this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING); // CraftBukkit } public EntityLargeFireball(World world, EntityLiving entityliving, double d0, double d1, double d2) { super(EntityTypes.FIREBALL, entityliving, d0, d1, d2, world); + isIncendiary = this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING); // CraftBukkit } @Override @@ -29,7 +33,15 @@ if (!this.world.isClientSide) { boolean flag = this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING); - this.world.createExplosion((Entity) null, this.locX(), this.locY(), this.locZ(), (float) this.yield, flag, flag ? Explosion.Effect.DESTROY : Explosion.Effect.NONE); + // CraftBukkit start - fire ExplosionPrimeEvent + ExplosionPrimeEvent event = new ExplosionPrimeEvent((org.bukkit.entity.Explosive) this.getBukkitEntity()); + this.world.getServer().getPluginManager().callEvent(event); + + if (!event.isCancelled()) { + // give 'this' instead of (Entity) null so we know what causes the damage + this.world.createExplosion(this, this.locX(), this.locY(), this.locZ(), event.getRadius(), event.getFire(), flag ? Explosion.Effect.DESTROY : Explosion.Effect.NONE); + } + // CraftBukkit end this.die(); } @@ -60,7 +72,8 @@ public void loadData(NBTTagCompound nbttagcompound) { super.loadData(nbttagcompound); if (nbttagcompound.hasKeyOfType("ExplosionPower", 99)) { - this.yield = nbttagcompound.getInt("ExplosionPower"); + // CraftBukkit - set bukkitYield when setting explosionpower + bukkitYield = this.yield = nbttagcompound.getInt("ExplosionPower"); } }