I've recently been testing my server systems using KotlinBukkitAPI. And I noticed that every time I logged into the server, the events worked.\
But if I tried to do the exact same process I did for this event, it did not work.
I turned and they both worked, the two messages disappeared. But when I left the server and entered again, nothing happened.\
And then I started looking for the problem, and I found it.
The unregisterAll() method is called, correctly, but its reference is not correct.
The unregisterAll() that should be called is that of br.com.devsrsouza.kotlinbukkitapi.extensions, and what is being called is the org.bukkit.event.HandlerList#unregisterAll.
Solution
This is resolved by adding the correct import br.com.devsrsouza.kotlinbukkitapi.extensions.unregisterAll to the file.
Please resolve this as soon as possible because KotlinBukkitAPI, with this, is unusable.
What happened
I've recently been testing my server systems using KotlinBukkitAPI. And I noticed that every time I logged into the server, the events worked.\ But if I tried to do the exact same process I did for this event, it did not work.
I used this to test:
I turned and they both worked, the two messages disappeared. But when I left the server and entered again, nothing happened.\ And then I started looking for the problem, and I found it.
The problem
It is located in this class: https://github.com/DevSrSouza/KotlinBukkitAPI/blob/f702c0ed23f73d538fc8964ac8af5ee454813852/core/src/main/kotlin/br/com/devsrsouza/kotlinbukkitapi/collections/OnlinePlayerCollections.kt#L185
More specifically in this line: https://github.com/DevSrSouza/KotlinBukkitAPI/blob/f702c0ed23f73d538fc8964ac8af5ee454813852/core/src/main/kotlin/br/com/devsrsouza/kotlinbukkitapi/collections/OnlinePlayerCollections.kt#L199
The
unregisterAll()
method is called, correctly, but its reference is not correct. TheunregisterAll()
that should be called is that of br.com.devsrsouza.kotlinbukkitapi.extensions, and what is being called is theorg.bukkit.event.HandlerList#unregisterAll
.Solution
This is resolved by adding the correct import br.com.devsrsouza.kotlinbukkitapi.extensions.unregisterAll to the file.