Towny
Towny copied to clipboard
Suggestion: Equivalent to TownBlockPVPTestEvent for Explosions
Please explain your feature request to the best of your abilities:
The documentation for TownBlockPVPTestEvent
states that it is "thrown when Towny will determine the PVP status of a townblock, or plot, in a town." I am looking for an equivalent for explosions - an event thrown when Towny determines whether explosions will be enabled in a townblock/plot in a town. My personal use-case would using it to enable explosions everywhere inside a SiegeWar siege zone, but there are of course others.
They don't modify the townblock or town itself but I think you will find the TownyExplodingBlocksEvent and TownyExplosionDamagesEntityEvent up to spec here. Let me know if you have any questions.
My understanding - and please do correct me if I'm wrong - is that I can use TownyExplodingBlocksEvent to remove blocks from an explosion's block list, but I can't use it to enable explosions in a plot in the first place. That's a scenario where I think this hypothetical new event could be useful (in my case, I specifically want to enable explosions in a plot if it located inside a SiegeWar siege zone)
Yep, the event will be added after I assess it soon.
I just took a quick look into where this could be implemented — explosions are handled a bit more differently than I thought when making this suggestion, but I think TownyActionEventExecutor#isAllowedExplosion
could be a good place to fire this event?