Skip to content

Resolve reward editor sound keys and legacy sound names - #393

Merged
BenCodez merged 1 commit into
masterfrom
fix/reward-sound-keys
Nov 28, 2026
Merged

BenCodez merged 1 commit into
masterfrom
fix/reward-sound-keys

Conversation

@BenCodez

@BenCodez BenCodez commented Nov 28, 2026 •

Copy link
Copy Markdown
Owner

Reward sound editing now stores registry keys instead of registry-backed objects' debug strings. Reward playback and GUI click sounds share resolution for bare and namespaced keys, plus legacy enum-style Minecraft names without changing underscores inside keys (for example BLOCK_NOTE_BLOCK_CHIME). Invalid reward sounds produce a normal warning with bounded text and repetition. Playback location, volume, pitch and scheduling remain unchanged.

Addresses #392.

Validation:

  • Three regression checks fail against the original production paths and pass with the correction.
  • Nine sound tests cover editor output, canonical/namespaced/legacy inputs, malformed/null/blank/oversized/unknown values, playback parameters, offline behavior, warnings and legacy mixed click-sound compatibility and exact namespaced lookups; 39 existing built-in reward tests also pass.
  • JDK 21 Maven package: 1,787 ordinary tests plus two packaged-artifact checks pass.

Tests use synthetic registries and players. Live Paper playback and the in-game editor have not been exercised by this change's local tests.

The synthetic Bukkit registry bootstrap is isolated in a dedicated test classloader.

Summary by CodeRabbit

  • Bug Fixes
    • Sound settings now resolve recognized sound names more consistently, including legacy underscore-form names. Explicitly namespaced sounds are matched as entered.
    • Click sounds use a default when the configured value is invalid, while none continues to disable click sounds.
    • Unrecognized playback sounds now produce a limited, sanitized warning instead of failing silently.

@coderabbitai

coderabbitai Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The changes add a shared sound resolver and use it for click-sound configuration, user playback, and reward-editor sound options. Tests cover key parsing, aliases, fallbacks, playback, and invalid-sound warnings.

Changes: Sound Resolution and Playback

Layer / File(s) Summary
Shared sound resolution and click configuration
AdvancedCore/src/main/java/com/bencodez/advancedcore/api/misc/SoundResolver.java, AdvancedCore/src/main/java/com/bencodez/advancedcore/AdvancedCoreConfigOptions.java, AdvancedCore/src/test/java/com/bencodez/advancedcore/tests/sound/*
SoundResolver parses and resolves sound keys, formats configuration keys, and handles click-sound aliases and fallbacks. Click-sound configuration delegates to the resolver. Tests cover key formats, invalid inputs, and click-sound behavior.
Reward editor and playback integrations
AdvancedCore/src/main/java/com/bencodez/advancedcore/api/rewards/editbuttons/RewardEditSound.java, AdvancedCore/src/main/java/com/bencodez/advancedcore/api/user/AdvancedCoreUser.java, AdvancedCore/src/test/java/com/bencodez/advancedcore/tests/sound/SoundResolutionFixture.java
The reward editor uses stable configuration keys. User playback uses the resolver and logs invalid sounds at most once per 30 seconds per user. Tests cover editor options, playback, and warning output.

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

Change: Bug fix · Severity of issue fixed: Medium

Sequence Diagram(s)

sequenceDiagram
  participant AdvancedCoreUser
  participant SoundResolver
  participant SoundRegistry
  participant Player
  participant Logger
  AdvancedCoreUser->>SoundResolver: resolve configured sound name
  SoundResolver->>SoundRegistry: look up parsed key
  SoundRegistry-->>SoundResolver: matching sound or no match
  SoundResolver-->>AdvancedCoreUser: sound or null
  alt Sound resolved
    AdvancedCoreUser->>Player: play sound at player location
  else No sound resolved
    AdvancedCoreUser->>Logger: emit rate-limited warning
  end
Loading

Possibly related issues

  • Issue 392: The changes address the reported editor key formatting, legacy sound-name resolution, and differing click-sound and reward-playback formats. The provided summary notes that live-game editor list behavior was not fully exercised.
Merge Risk: Minimal · up to 7a40c

This change stores sound registry keys in the reward editor and resolves bare, namespaced, and legacy sound names the same way for reward playback and click sounds. No concrete defect was identified. The remaining uncertainty is limited to live-server behavior that the tests do not cover, so it is ready to merge after normal checks.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the two main changes in the PR: reward editor sound keys (RewardEditSound now stores configurationKey output) and legacy sound names (SoundResolver matches names such as BLOCK_NOTE_BLO…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the two main changes in the PR: reward editor sound keys (RewardEditSound now stores configurationKey output) and legacy sound names (SoundResolver matches names such as BLOCK_NOTE_BLOCK_CHIME). The changeset adds SoundResolver, updates AdvancedCoreUser.playSound and AdvancedCoreConfigOptions to use it, and adds tests. The title is specific and matches the primary objective in the PR summary.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • 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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8330c80c-691c-4b88-af3c-5543c430d41c
Commits

Reviewing files that changed from the base of the PR and between 04a0eb9 and 7a40cfe.

Files selected for processing: 6

  • AdvancedCore/src/main/java/com/bencodez/advancedcore/AdvancedCoreConfigOptions.java
  • AdvancedCore/src/main/java/com/bencodez/advancedcore/api/misc/SoundResolver.java
  • AdvancedCore/src/main/java/com/bencodez/advancedcore/api/rewards/editbuttons/RewardEditSound.java
  • AdvancedCore/src/main/java/com/bencodez/advancedcore/api/user/AdvancedCoreUser.java
  • AdvancedCore/src/test/java/com/bencodez/advancedcore/tests/sound/SoundResolutionFixture.java
  • AdvancedCore/src/test/java/com/bencodez/advancedcore/tests/sound/SoundResolutionTest.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.

Recent review details

Context from checks skipped due to timeout: 3

  • GitHub Check: build
  • GitHub Check: Analyze (actions)
  • GitHub Check: Analyze (java-kotlin)
Additional context used

Code guidelines: 1

AGENTS.md — auto-discovered
Path-based instructions: 2

Source excerpt: AdvancedCore is a shared Bukkit/Paper/Folia library embedded by plugins such as VotingPlugin, MCPerks, and GraveStonesPlus.

CodeRabbit inference engine (AGENTS.md)

Files:

  • AdvancedCore/src/main/java/com/bencodez/advancedcore/AdvancedCoreConfigOptions.java
  • AdvancedCore/src/main/java/com/bencodez/advancedcore/api/misc/SoundResolver.java
  • AdvancedCore/src/main/java/com/bencodez/advancedcore/api/rewards/editbuttons/RewardEditSound.java
  • AdvancedCore/src/main/java/com/bencodez/advancedcore/api/user/AdvancedCoreUser.java
  • AdvancedCore/src/test/java/com/bencodez/advancedcore/tests/sound/SoundResolutionFixture.java
  • AdvancedCore/src/test/java/com/bencodez/advancedcore/tests/sound/SoundResolutionTest.java
Source excerpt: All test classes and test-only helpers must live under `com.bencodez.advancedcore.tests` or its subpackages, with matching directories under `AdvancedCore/src/test/java`.

CodeRabbit inference engine (AGENTS.md)

Files:

  • AdvancedCore/src/test/java/com/bencodez/advancedcore/tests/sound/SoundResolutionFixture.java
  • AdvancedCore/src/test/java/com/bencodez/advancedcore/tests/sound/SoundResolutionTest.java
Learnings: 5

Learning: 2026-11-16T20:27:41.191Z

Learnt from: CR
Repo: BenCodez/AdvancedCore PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-11-16T20:27:41.191Z
Learning: Applies to ** : Source excerpt:
# Maintainer and AI-agent guide

AdvancedCore is a shared Bukkit/Paper/Folia library embedded by plugins such as VotingPlugin, MCPerks, and GraveStonesPlus. Changes can affect downstream plugins even when this repository builds successfully, so preserve public behavior and packaged compatibility unless a breaking change is explicitly authorized.

Applied to files:

  • AdvancedCore/src/main/java/com/bencodez/advancedcore/AdvancedCoreConfigOptions.java
  • AdvancedCore/src/main/java/com/bencodez/advancedcore/api/misc/SoundResolver.java
  • AdvancedCore/src/main/java/com/bencodez/advancedcore/api/user/AdvancedCoreUser.java
Learning: 2026-11-16T20:27:03.870Z

Learnt from: CR
Repo: BenCodez/AdvancedCore PR: 0
File: .github/skills/code-review/SKILL.md:0-0
Timestamp: 2026-11-16T20:27:03.870Z
Learning: Source excerpt:
# AdvancedCore code review

## 3. Trace changed behavior and its contracts

### AdvancedCore compatibility and behavior

- Treat AdvancedCore as a shared API used by downstream plugins, including
  VotingPlugin. Check public signatures, overloads, visibility, return values,
  callback/thread contracts, defaults, and source/binary compatibility. Trace the
  pinned SimpleAPI or other dependency contract when the change relies on it.

Applied to files:

  • AdvancedCore/src/main/java/com/bencodez/advancedcore/AdvancedCoreConfigOptions.java
Learning: 2026-11-16T20:27:41.191Z

Learnt from: CR
Repo: BenCodez/AdvancedCore PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-11-16T20:27:41.191Z
Learning: Applies to ** : Source excerpt:
# Maintainer and AI-agent guide

## Compatibility-first change policy

Compatibility is the default acceptance criterion for every new feature, refactor, fix, storage change, and dependency change. Unless the task explicitly authorizes a breaking change:

- Existing plugins embedding or calling AdvancedCore must continue to compile and run without source, configuration, dependency, or deployment changes.

Applied to files:

  • AdvancedCore/src/main/java/com/bencodez/advancedcore/AdvancedCoreConfigOptions.java
  • AdvancedCore/src/main/java/com/bencodez/advancedcore/api/misc/SoundResolver.java
  • AdvancedCore/src/main/java/com/bencodez/advancedcore/api/user/AdvancedCoreUser.java
Learning: 2026-11-16T20:27:41.191Z

Learnt from: CR
Repo: BenCodez/AdvancedCore PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-11-16T20:27:41.191Z
Learning: Applies to ** : Source excerpt:
# Maintainer and AI-agent guide

## Compatibility-first change policy

Compatibility is the default acceptance criterion for every new feature, refactor, fix, storage change, and dependency change. Unless the task explicitly authorizes a breaking change:

- Existing plugins embedding or calling AdvancedCore must continue to compile and run without source, configuration, dependency, or deployment changes.
- Preserve public and de-facto APIs, constructors, overloads, callback/threading behavior, configuration keys/defaults, serialized forms, database semantics, shaded packages, and reflection-visible names used by downstream plugins.
- New configuration must be additive: existing files remain valid, missing new keys preserve the previous behavior, and no manual config regeneration or edits are required.
- Existing persisted user data and database state must remain readable. Any required migration must happen automatically, be restart-safe and idempotent, a...

Applied to files:

  • AdvancedCore/src/main/java/com/bencodez/advancedcore/api/misc/SoundResolver.java
Learning: 2026-11-16T20:27:41.191Z

Learnt from: CR
Repo: BenCodez/AdvancedCore PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-11-16T20:27:41.191Z
Learning: Applies to ** : Source excerpt:
# Maintainer and AI-agent guide

## Compatibility-first change policy

Compatibility is the default acceptance criterion for every new feature, refactor, fix, storage change, and dependency change. Unless the task explicitly authorizes a breaking change:

- Preserve public and de-facto APIs, constructors, overloads, callback/threading behavior, configuration keys/defaults, serialized forms, database semantics, shaded packages, and reflection-visible names used by downstream plugins.

Applied to files:

  • AdvancedCore/src/main/java/com/bencodez/advancedcore/api/misc/SoundResolver.java
Additional comments: 6

AdvancedCore/src/main/java/com/bencodez/advancedcore/api/misc/SoundResolver.java: 1

1-85: LGTM!

AdvancedCore/src/main/java/com/bencodez/advancedcore/AdvancedCoreConfigOptions.java: 1

9-9: LGTM!

Also applies to: 666-668

AdvancedCore/src/test/java/com/bencodez/advancedcore/tests/sound/SoundResolutionFixture.java: 1

1-233: LGTM!

AdvancedCore/src/test/java/com/bencodez/advancedcore/tests/sound/SoundResolutionTest.java: 1

1-63: LGTM!

AdvancedCore/src/main/java/com/bencodez/advancedcore/api/rewards/editbuttons/RewardEditSound.java: 1

9-9: LGTM!

Also applies to: 25-25

AdvancedCore/src/main/java/com/bencodez/advancedcore/api/user/AdvancedCoreUser.java: 1

42-42: LGTM!

Also applies to: 595-595, 2827-2827, 2831-2841

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-28T20:09:01.813496Z 7a40cfe PR opened
🔒 Security Review ✅ Completed 2026-11-28T20:10:38.417632Z 7a40cfe PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@BenCodez
BenCodez merged commit 7a11b63 into master Nov 28, 2026
6 checks passed
@BenCodez
BenCodez deleted the fix/reward-sound-keys branch November 28, 2026 20:44
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