Skip to content

Count roleplay chat only when someone else hears it - #96

Merged
XxFran10xX merged 1 commit into
mainfrom
feat/rp-chat-listener
Oct 20, 2026
Merged

XxFran10xX merged 1 commit into
mainfrom
feat/rp-chat-listener

Conversation

@XxFran10xX

Copy link
Copy Markdown
Contributor

Summary

The Roleplay Chat activity (ic_chat) counted in-character messages even when nobody was around to hear them. A message now counts only if RPCharacters delivered it to at least one other player.

  • CharacterChatListener reads CharacterChatEvent#getRecipients(). RPCharacters fills this from the channel's radius (rp 15, whisper 2, shout 24, yell 48, action/scene 20, dm 64) and always includes the sender.
  • Spectators and vanished players (EssentialsX vanished metadata) do not count as listeners.
  • Unheard messages are skipped before the repeat history, so a line said alone can still count once someone hears it.
  • The default ic_chat tooltip gains "Someone else must be in earshot." Existing servers keep their config.yml, so the line has to be added there by hand.

Testing

  • mvn clean verify: all 962 tests pass, and CharacterChatListener has full line and branch coverage. Locally the coverage gate only misses lines in ActivityCommand/PlayerStore, because their POSIX-permission tests are skipped on Windows. CI runs them on Linux.
  • Dev (TFMCDev01) with two character bots, TestChar1 speaking /rp and TestChar2 listening, ic_chat revealed, 9/9 checks passed:
    • speaking alone does not count
    • a rehearsed line counts once a listener is 3 blocks away
    • a new line with a listener counts
    • a listener in spectator mode does not count
    • a listener vanished with /vanish does not count
    • the same listener visible again counts
    • a listener 40 blocks away (outside rp's range of 15) does not count
    • the listener speaking does not credit the speaker

🤖 Generated with Claude Code

The Roleplay Chat activity counted messages sent to nobody. A message now
counts only if RPCharacters delivered it to at least one other player in
the channel's radius. Spectators and vanished staff do not count as
listeners. Unheard lines are skipped before the repeat history, so a line
rehearsed alone can still count once someone hears it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@XxFran10xX

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2f143b26-f65f-4010-aad1-fe212204ad95
📥 Commits

Reviewing files that changed from the base of the PR and between a795808 and bd284de.

📒 Files selected for processing: 4
  • src/main/java/net/tfminecraft/activitytf/listeners/CharacterChatListener.java
  • src/main/resources/config.yml
  • src/test/java/net/tfminecraft/activitytf/listeners/CharacterChatChannelTest.java
  • src/test/java/net/tfminecraft/activitytf/listeners/ListenerBoundaryCoverageTest.java

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

📝 Summary

Summary by CodeRabbit

  • Bug Fixes

    • Roleplay chat is now ignored when no eligible non-spectator, non-vanished player is within earshot.
    • Messages that nobody can hear no longer affect chat history or activity credit.
    • Chat is recorded correctly when another visible player can receive it.
    • Handling now covers empty recipient lists and recipients who are spectators or vanished.
  • Documentation

    • Updated the ic_chat activity description to clarify that another person must be within earshot.

Character chat now affects activity history and credit only when another eligible player can hear it. The activity description and listener tests reflect this requirement.

Changes: Character chat listener

Layer / File(s) Summary
Filter chat by eligible listeners
src/main/java/net/tfminecraft/activitytf/listeners/CharacterChatListener.java, src/main/resources/config.yml, src/test/java/net/tfminecraft/activitytf/listeners/*
The listener ignores chat when no eligible recipient is present. It excludes the sender, spectators, vanished players, and null recipients. Tests cover recipient eligibility, and the activity description states that another person must be within earshot.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: ryanbarlow97

Merge Risk: ⚪ Minimal · up to bd284

Roleplay chat now counts only when another eligible player can hear it. I found no concrete merge-blocking risk. Existing config.yml files need the new tooltip line added manually.

- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added the size:M 30-99 effective changed lines (tests excluded in mixed PRs). label Oct 20, 2026
@coderabbitai

coderabbitai Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@XxFran10xX
XxFran10xX merged commit 3e90aa4 into main Oct 20, 2026
7 checks passed
@XxFran10xX
XxFran10xX deleted the feat/rp-chat-listener branch October 20, 2026 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 effective changed lines (tests excluded in mixed PRs).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant