Closed nosefish closed 10 years ago
Sounds like a good idea. In the meantime, depending on your situation, you could get the activator from the DamageSource
(e.g. with PluginListener.onDamage(HookParametersDamage)
and HookParametersDamage.getDamageSource()
).
The concrete issue I'm having is this: https://bitbucket.org/minecraftonline/fishyshield/issue/9/tnt-is-activated-by-fire-when-it-should - infinite tnt explosions when the block is next to fire. Try placing a tnt block next to the flames of a burning netherrack on minecraftonline.com. I want to be able to get that right in my plugin.
Won't fix; classic is deprecated now.
As far as I can tell there is currently no way to find out if a TNT block has been activated before it explodes. OEntityTNTPrimed has a field that contains the OEntityLiving which activated it and a method to access that field. I'd love to be able to use that, too.
So my suggestion is: create a class, e.g. "PrimedTNT", as a wrapper for OEntityTNTPrimed. Create an interface, e.g. "ExplosiveEntity", that PrimedTNT and TNTMinecart implement Add a hook for the event of TNT activation, with the Block and the ExplosiveEntity as parameters (Block would obviously be null for minecarts).