Closed Spliterash closed 2 years ago
Hello, thank you for reporting and fixing this. This problem was probably introduced in 2.6.0 by moving from standard event to plugin event. It may even be better to revert the 2.6.0 change in MCCoroutine. However, I may need some days until I can work on it.
@Shynixn No it's not that. It's just that bukkit requires you to explicitly specify what type of event (synchronous or asynchronous), and PluginEvent does not have the right constructor where you can pass this parameter
I see but there may be more to that. The MCCoroutine docs explicitly state how the MCCoroutineException event is always going to arrive on the primary thread. https://shynixn.github.io/MCCoroutine/wiki/site/exception/ That's the way I have designed it and according to your error something is not right.
Can you please send a short code snippet to trigger that error?
plugin.scope.launch(asyncDispatcher) {
throw RuntimeException("Exception in async dispatcher")
}
I have done some testing:
Thanks for your help.
When plugin use asyncEventDispatcher in coroutines, and inside coroutines drop exception, bukkit crash, because exception throws not in main thread