Teach EnderDragon how to throw EntityExplosionEvents when it breaks blocks

We also teach CraftWorld how to explode an event, taken from
Explosion.a(boolean) (the code that breaks blocks and drops them on the ground).

The EnderDragon has a flag that slows it down when it hits unbreakable blocks:
Obsidian, White Stone or Bedrock. It might be useful to extend the event so that
plugins can set this.

Letting the API set the default yield for an explosion event has been
deprecated, so we now set the default yield using the appropriate constructor.
This commit is contained in:
Andrew Ardill
2011-12-08 00:23:06 +11:00
parent 4e318dd1c8
commit b08b85bd26
3 changed files with 49 additions and 6 deletions

View File

@@ -185,7 +185,7 @@ public class Explosion {
}
}
EntityExplodeEvent event = new EntityExplodeEvent(explode, location, blockList);
EntityExplodeEvent event = new EntityExplodeEvent(explode, location, blockList, 0.3F);
this.world.getServer().getPluginManager().callEvent(event);
arraylist.clear();