FallenMoonNetwork / CanaryMod

Server administration mod and API for Minecraft beta multiplayer server
http://canarymod.net
GNU Lesser General Public License v3.0
20 stars 14 forks source link

Feature request: onTNTActivated hook #150

Closed nosefish closed 10 years ago

nosefish commented 11 years ago

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).

14mRh4X0r commented 11 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()).

nosefish commented 11 years ago

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.

14mRh4X0r commented 10 years ago

Won't fix; classic is deprecated now.