Skip to content

Always ping if prefix is empty & fix quick prefix functionality#761

Open
vilhu-github wants to merge 6 commits intoHexaoxide:trunkfrom
vilhu-github:trunk
Open

Always ping if prefix is empty & fix quick prefix functionality#761
vilhu-github wants to merge 6 commits intoHexaoxide:trunkfrom
vilhu-github:trunk

Conversation

@vilhu-github
Copy link
Copy Markdown

@vilhu-github vilhu-github commented Mar 21, 2026

Leaving the ping prefix empty in the config may result in odd behaviour. This checks if the string is empty, and always pings if matched.

Also fixes quick prefix for channels, not sure if that's an ideal way to do it but it works,

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adjusts chat ping matching when the configured ping prefix is empty, and changes Paper chat handling to preserve/propagate the selected channel when quick-prefix channel selection is involved.

Changes:

  • Update ping regex generation so an empty ping prefix matches bare username/display-name mentions.
  • Track the resolved chat channel during Paper’s decorate phase and reuse it during the actual chat event to improve quick-prefix channel behavior.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
paper/src/main/java/net/draycia/carbon/paper/listeners/PaperChatListener.java Stores a per-player channel key during decorate and uses it to select the channel during AsyncChatEvent handling.
common/src/main/java/net/draycia/carbon/common/listeners/PingHandler.java Builds a different ping regex when prefix is empty to always ping on username/display-name mention.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

vilhu-github and others added 3 commits March 21, 2026 23:01
…atListener.java


Approve Copilot suggestion: improve fallback logic for message routing

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@vilhu-github
Copy link
Copy Markdown
Author

vilhu-github commented Mar 22, 2026

Commit 25b2cc7 seems to fix desync issues, apparently caused by blocking retrieval of data leading to the player getting disconnected:

[ERROR]: Failed to validate message acknowledgements from player: Checksum mismatch on last seen update: the client and server must have desynced

After this, I haven't encountered this issue again. See Copilot's notes for more information.

EDIT:
My fix attempts can be found here: https://github.com/vilhu-github/Carbon/tree/develop. I was unable to fix the issue entirely, though the amount of errors did decrease. Anyone more skilled is free to use my code if it helps to find a fix.

@vilhu-github vilhu-github marked this pull request as draft March 22, 2026 19:46
@vilhu-github vilhu-github changed the title If ping prefix is empty in config, always ping on username mention Always ping if prefix is empty, addressing checksum desync issues Mar 23, 2026
@vilhu-github vilhu-github changed the title Always ping if prefix is empty, addressing checksum desync issues Always ping if prefix is empty & fix quick prefix functionality Mar 24, 2026
@vilhu-github
Copy link
Copy Markdown
Author

No changes after modifications based on Copilot's feedback. The errors with checksum mismatches are deeper than I originally expected. This only addresses the ping feature and quick prefix.

@vilhu-github vilhu-github marked this pull request as ready for review March 24, 2026 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants