whimxiqal / journey

A server-side path-finding Minecraft plugin
MIT License
14 stars 3 forks source link

Remove event dispatcher #46

Closed whimxiqal closed 1 year ago

whimxiqal commented 1 year ago

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.

whimxiqal commented 1 year ago

Fixed with #49