Skip to content

feat: add duel banners and private result feedback - #123

Merged
ryanbarlow97 merged 3 commits into
mainfrom
feat/duel-banner
Oct 16, 2026
Merged

ryanbarlow97 merged 3 commits into
mainfrom
feat/duel-banner

Conversation

@ryanbarlow97

@ryanbarlow97 ryanbarlow97 commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Friendly duels now plant a blue and gold banner between the players when a challenge is sent. The banner stays through acceptance and the countdown, then disappears when the duel finishes. Displays have no hitbox and never replace blocks; decline, withdrawal, expiration, selection, logout and shutdown also clean them up.

Duel chat notices are private to the participants by default (announce-radius: 0); nearby announcements require an explicit positive radius. Visible names use character display names, respecting aliases and masks.

Both players receive countdown and start sounds. Victories, defeats, yields and draws have individual titles, subtitles and sounds. Existing duel damage, restoration and injury rules are preserved. New messages have defaults, so existing duel.yml files remain compatible.

Validation: tfmc-mvn -o -B --no-transfer-progress clean verify passed all 2,509 tests and the 100% line coverage gate. Nineteen duel tests cover ownership, cleanup, ground placement, idempotence and private feedback.

Dev test build: DEV-20261016-duel-7d00fde, SHA-256 82ecdc5db0641ca0f808361b299101932b801b3655d004385cd4f5aa40a0682f, deployed to TFMCDev01 only.

Two independent vanilla 1.21.10 clients loaded Dev's resource pack and exercised real /duel commands and mouse attacks. The final combat pass applied two sword hits and cancelled the lethal third; health returned to 21.2/21.2, with no deaths, knockouts or strikes. Both clients received victory/defeat feedback. Yield, distance draw, decline, cancel, challenge expiry and pending cleanup on character selection also passed, with zero leftover banners. Native audio and both views were recorded.

Live inspection caught the banner model's half-block origin offset; the final build plants its pole on the ground, covered by an added assertion. The console-only helper and 682 fixture blocks were removed/restored after testing, along with temporary Dev-scoped permissions and the isolated forwarding proxy. Essentials' existing teleport-protection delay is respected by the test harness. No production test hooks were added.

Docs: TF-Minecraft/Docs#279

Dev privacy setting: existing DEV-20261016-duel-7d00fde build now runs with announce-radius: 0, applied through AMP and the supported /rpcharacter reload configuration refresh. No JAR or server reload was used. Two new regression tests verify no nearby chat for starts/results and character display names instead of account names.

@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 51 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f3473a79-0ea9-454b-9734-b1e9f8b1b920
📥 Commits

Reviewing files that changed from the base of the PR and between 7d00fde and b7b6354.

📒 Files selected for processing: 3
  • src/main/java/net/tfminecraft/rpcharacters/loaders/DuelLoader.java
  • src/main/resources/duel.yml
  • src/test/java/net/tfminecraft/rpcharacters/pvp/DuelsTest.java

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: 1b1a2103-a385-4f76-9d96-97078fd43213
📥 Commits

Reviewing files that changed from the base of the PR and between 526e0fc and 7d00fde.

📒 Files selected for processing: 6
  • src/main/java/net/tfminecraft/rpcharacters/loaders/DuelLoader.java
  • src/main/java/net/tfminecraft/rpcharacters/pvp/Duel.java
  • src/main/java/net/tfminecraft/rpcharacters/pvp/DuelBanner.java
  • src/main/java/net/tfminecraft/rpcharacters/pvp/Duels.java
  • src/main/resources/duel.yml
  • src/test/java/net/tfminecraft/rpcharacters/pvp/DuelsTest.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

  • New Features
    • Duel challenges now display a temporary banner between players, which is removed when the challenge or duel ends.
    • Added title and subtitle notifications for duel victories, defeats, yields, draws and interruptions.
    • Countdown and fight-start transitions now include sound effects.

Duel challenges now display a temporary banner, and countdowns and outcomes send titles and sounds. Challenge and duel cleanup removes banners. The configuration and tests cover these changes.

Changes: Duel lifecycle and notifications

Layer / File(s) Summary
Banner state and display
src/main/java/net/tfminecraft/rpcharacters/pvp/Duel.java, src/main/java/net/tfminecraft/rpcharacters/pvp/DuelBanner.java
A duel can retain and remove its banner. DuelBanner creates a patterned display, adjusts its position when a block ray hit is found, and removes it once.
Challenge and duel banner lifecycle
src/main/java/net/tfminecraft/rpcharacters/pvp/Duels.java, src/test/java/net/tfminecraft/rpcharacters/pvp/DuelsTest.java
Challenges plant and retain banners. Challenge replacement, removal, expiry, shutdown, and duel completion remove the associated banner. Tests cover placement and lifecycle cleanup.
Countdown and result notifications
src/main/java/net/tfminecraft/rpcharacters/pvp/Duels.java, src/main/java/net/tfminecraft/rpcharacters/loaders/DuelLoader.java, src/main/resources/duel.yml, src/test/java/net/tfminecraft/rpcharacters/pvp/DuelsTest.java
Countdowns and duel outcomes send titles and sounds. Default messages, configuration descriptions, and tests cover these notifications.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant Duels
  participant DuelBanner
  participant Duel
  Duels->>DuelBanner: Plant banner for a challenge
  Duels->>Duel: Begin accepted duel with its banner
  Duels->>Duel: Remove banner when duel ends
  Duel->>DuelBanner: Remove and clear banner
Loading

Suggested reviewers: xxfran10xx

Merge Risk: ⚪ Minimal · up to 7d00f

This change adds duel banners and result cues with cleanup on all described paths. No actionable merge-blocking risk was identified.

- [ ] 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:L 100-499 effective changed lines (tests excluded in mixed PRs). label Oct 16, 2026
@ryanbarlow97
ryanbarlow97 marked this pull request as ready for review October 16, 2026 14:59
coderabbitai[bot]
coderabbitai Bot previously approved these changes Oct 16, 2026
@ryanbarlow97 ryanbarlow97 changed the title feat: mark friendly duels with banners and result cues feat: add duel banners and private result feedback Oct 16, 2026
@ryanbarlow97
ryanbarlow97 merged commit 5ebf516 into main Oct 16, 2026
3 checks passed
@ryanbarlow97
ryanbarlow97 deleted the feat/duel-banner branch October 16, 2026 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 effective changed lines (tests excluded in mixed PRs).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant