Add support for AsyncChatEvent in Paper server
Information
This PR fixes #5243.
Details
Proposed fix:
Since the EssentialsDiscord plugin only listens to AsyncPlayerChatEvent, which is called before calling AsyncChatEvent, any changes made to the message in the latter event will be ignored by the plugin. In order to fix it, I've added some classes to the PaperProvider and a new async event which will be called each time an AsyncChatEvent is received. The plugin checks if the AsyncChatEvent exists and registers the two listeners needed instead of the bukkit one.
Environments tested:
OS: Ubuntu 24.04 LTS
Java version: Oracle GraalVM 21.0.3+7.1
- [x] Most recent Paper version (1.XX.Y, git-Paper-BUILD)
- [ ] CraftBukkit/Spigot/Paper 1.12.2
- [ ] CraftBukkit 1.8.8
Demonstration:
I've found a little bug when receiving the AsyncChatEvent synchronously (I didn't know that was possible). I'm fixing it.
Fixed, it should work now.
Is there anything else I should do for this to get approved? It requires nothing from the user and improves their experience when running Paper, fixing incompatibilities with other plugins.
I will get to it I promise 😁
I'm waiting on #6033 before this one
I'm sorry. I'm not used to the review system. After our last conversation, no one replied, and I noticed a check next to your name stating that I had something pending. I thought I had to manually re-request a review after closing the conversation and so did I. Sorry if I caused any inconvenience, for the next time I'll know it is not needed.
De: Euphyllia @.> Enviado: jueves, 13 de febrero de 2025 19:25 Para: EssentialsX/Essentials @.> Cc: Hernán Indíbil de la Cruz Calvo @.>; Author @.> Asunto: Re: [EssentialsX/Essentials] Add support for AsyncChatEvent in Paper server (PR #5908)
[Euphillya]Euphillya left a comment (EssentialsX/Essentials#5908)https://github.com/EssentialsX/Essentials/pull/5908#issuecomment-2657410132
why ask me to do a review?
— Reply to this email directly, view it on GitHubhttps://github.com/EssentialsX/Essentials/pull/5908#issuecomment-2657410132, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABGHXRJNHXSTYJUS4UNYYMT2PTPTLAVCNFSM6AAAAABMUOGMTKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMNJXGQYTAMJTGI. You are receiving this because you authored the thread.
I don't know what you did there, but after the update I have an error in the chat after the Chat Game.
Could not pass event AsyncChatEvent to EssentialsChat v2.21.0-dev+169-69ed07a java.lang.NullPointerException: null
What should I do now? Delete the game from the server?
Server Paper 1.21.4-152
Are you saying you are having an incompatibility problem between Chat Game and the code from this fork? Or with the latest EssentialsDiscord version? If it's with this fork, could you provide the logs?
Are you saying you are having an incompatibility problem between Chat Game and the code from this fork? Or with the latest EssentialsDiscord version? If it's with this fork, could you provide the logs?
https://github.com/EssentialsX/Essentials/issues/6051