Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for AsyncChatEvent in Paper server #5908

Open
wants to merge 6 commits into
base: 2.x
Choose a base branch
from

Conversation

Mowstyl
Copy link

@Mowstyl Mowstyl commented Aug 16, 2024

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

  • Most recent Paper version (1.XX.Y, git-Paper-BUILD)
  • CraftBukkit/Spigot/Paper 1.12.2
  • CraftBukkit 1.8.8

Demonstration:

@mdcfe mdcfe self-requested a review August 16, 2024 21:41
@Mowstyl
Copy link
Author

Mowstyl commented Aug 17, 2024

I've found a little bug when receiving the AsyncChatEvent synchronously (I didn't know that was possible). I'm fixing it.

@Mowstyl
Copy link
Author

Mowstyl commented Aug 17, 2024

Fixed, it should work now.

@mdcfe mdcfe added this to the 2.21.1 milestone Sep 1, 2024
@mdcfe mdcfe added the module: discord Issues or PRs for the EssentialsDiscord module label Sep 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: discord Issues or PRs for the EssentialsDiscord module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

EssentialsX Discord doesn't support Paper chat events
3 participants