I created an event dispatcher to relay events to Bukkit's event system to avoid creating my own event queue, thinking that an event queue was the best way to manage state in sessions. I don't think this is actually a good idea and it's been the source of some bugs and convolution.
The event dispatcher should just be removed altogether and all the places where events are dispatched should just directly call methods where appropriate. For example, many of the Start/StopPath/Itinerary events just broadcast a debug statement, so that can just be called directly wherever that event is dispatched. It's best to watch out for concurrency issues, though.
I created an event dispatcher to relay events to Bukkit's event system to avoid creating my own event queue, thinking that an event queue was the best way to manage state in sessions. I don't think this is actually a good idea and it's been the source of some bugs and convolution.
The event dispatcher should just be removed altogether and all the places where events are dispatched should just directly call methods where appropriate. For example, many of the
Start/Stop
Path/Itinerary
events just broadcast a debug statement, so that can just be called directly wherever that event is dispatched. It's best to watch out for concurrency issues, though.