You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat: add duel banners and private result feedback - #123
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.
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.
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.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
size:L100-499 effective changed lines (tests excluded in mixed PRs).
1 participant
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 verifypassed 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-25682ecdc5db0641ca0f808361b299101932b801b3655d004385cd4f5aa40a0682f, deployed to TFMCDev01 only.Two independent vanilla 1.21.10 clients loaded Dev's resource pack and exercised real
/duelcommands 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-7d00fdebuild now runs withannounce-radius: 0, applied through AMP and the supported/rpcharacter reloadconfiguration 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.