Essentials
Essentials copied to clipboard
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: