espidev / ProtectionStones

A useful and intuitive Minecraft region protection plugin that uses a certain block to protect regions.
https://www.spigotmc.org/resources/protectionstones-updated-for-1-13-wg7.61797/
GNU General Public License v3.0
69 stars 36 forks source link

breaking protection stones now trigger PSRemoveEvent #418

Closed rinpr closed 5 months ago

rinpr commented 5 months ago

might be useful for plugin developers

espidev commented 5 months ago

PSRemoveEvent is only supposed to be triggered when a region is removed (ex. https://github.com/espidev/ProtectionStones/blob/master/src/main/java/dev/espi/protectionstones/PSStandardRegion.java#L498), this will cause issues with existing event handlers since it will trigger even if the region isn't removed...

Perhaps you want to introduce a new sort of event? What is the usecase here?

rinpr commented 5 months ago

PSRemoveEvent is only supposed to be triggered when a region is removed (ex. https://github.com/espidev/ProtectionStones/blob/master/src/main/java/dev/espi/protectionstones/PSStandardRegion.java#L498), this will cause issues with existing event handlers since it will trigger even if the region isn't removed...

Perhaps you want to introduce a new sort of event? What is the usecase here?

I tried to add a protection stone breaking fee with my other plugins, and I noticed that the PSRemoveEvent is not triggered when breaking a ProtectionStone. So, I attempted to patch that up. If I don’t want to create a new event for this, should I add a new RemoveCause to the existing PSRemoveEvent?

espidev commented 5 months ago

I noticed that the PSRemoveEvent is not triggered when breaking a ProtectionStone.

It doesn't trigger at all? That would be a bug... If the region is successfully removed it should trigger

rinpr commented 5 months ago

It doesn't trigger at all? That would be a bug... If the region is successfully removed it should trigger

Oh sorry what I meant is it triggered twice