Bukkit/CraftBukkit — pull request #1114 by Black-Hole (2013-03-30 23:49:10+00:00)
Title: [B+C] Implement Explosive and call ExplosionPrimeEvent for ExplosiveMinecart. Adds BUKKIT-3905

The Issue:
No ExplosionPrimeEvent is called for ExplosiveMinecart, so you can't cancel the explosion, only the affected blocks. Entities still gets damaged.

PR Breakdown:
With this PR ExplosiveMinecart implements Explosive. So you can also setup the fuse time. The yield is inialized with -1, since the calculation of the explosion power depends on fall damage etc. If the yield is modified before the explosion, that value is used. Otherwise the vanilla calculation will take place. (Maybe someone finds a better solution for this?)
The ExplosionPrimeEvent is called with the yield (radius). The outcome of the event is then used for the explosion. If the event is canceled, no explosion will happen.

Testing Results and Materials:
If you have a plugin that listens to ExplosionPrimeEvent, it's easy to handle ExplosiveMinecart, too. Tests shows that no mobs or players gets hurt, if you cancel the event. If you alter the radius, the explosion will use that radius.

Relevant PR(s):
B-837 - https://github.com/Bukkit/CraftBukkit/pull/837
B-819 - https://github.com/Bukkit/Bukkit/pull/819 (should be updated to trigger for all explosives)
CB-1088 - https://github.com/Bukkit/CraftBukkit/pull/1088 (should be updated to trigger for all explosives)

JIRA Ticket:
BUKKIT-3905 - https://bukkit.atlassian.net/browse/BUKKIT-3905