@@ -20,24 +20,24 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -24,7 +28,15 @@
|
||||
@@ -25,7 +29,15 @@
|
||||
|
||||
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);
|
||||
- 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);
|
||||
+ 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();
|
||||
}
|
||||
|
||||
@@ -40,7 +52,8 @@
|
||||
@@ -41,7 +53,8 @@
|
||||
public void a(NBTTagCompound nbttagcompound) {
|
||||
super.a(nbttagcompound);
|
||||
if (nbttagcompound.hasKeyOfType("ExplosionPower", 99)) {
|
||||
|
||||
Reference in New Issue
Block a user