Add PlayerFlightChangeEvent
Adds a new event that triggers whenever a player toggles flight
The only other thing that might made sense is to make the event implement CancellableTownyEvent, so that it could be used by other plugins to stop flight in areas they don't want players flying.
Would you like a new lang string for when the event is cancelled? Or just an early return in addFlight and removeFlight?
If it's just early return then that should be good I think, otherwise I will revisit later.
Since TownyFlight itself never cancels the event wouldn't it make sense to let the plugin cancelling the event handle messaging?
Since TownyFlight itself never cancels the event wouldn't it make sense to let the plugin cancelling the event handle messaging?
That doesn't really make sense to me, the plugin cancelling it wouldn't know what the value of silent is and we've already got a getter/setter for the cancel message on the CancellableTownyEvent class
I forgot I'd done the silent flag a while ago and was waiting on response to the pr before pushing. I think I understand what preferred solution is now. With this implementation plugins cancelling the event can use setCancelMessage, however, they cannot modify if it should be silent or not. Let me know if I got that right, thanks!