Skip to content

chore: compact gem stat config with shared bands - #46

Merged
XxFran10xX merged 3 commits into
mainfrom
chore/compact-gem-config
Oct 17, 2026
Merged

XxFran10xX merged 3 commits into
mainfrom
chore/compact-gem-config

Conversation

@XxFran10xX

Copy link
Copy Markdown
Contributor

Change

Shorter gem config with every stat unchanged. Each gem now sets its stat once and lists each rarity's range on one line, either by naming a shared set or with its own ranges:

stat-bands:
    tier-2:
        common: 2.00-2.20
        rare: 2.30-2.50
        epic: 2.60-2.80
        legendary: 2.90-3.00

gems:
    coral:
        ...
        stat: physical_damage
        bands: tier-2
    agate:
        ...
        stat: max_health
        bands:
            common: 0.20-0.30
            rare: 0.30-0.40
            epic: 0.40-0.50
            legendary: 0.50-0.60
  • Bundled config.yml: 998 → 461 lines. 32 gems use the five shared sets (tier-1 to tier-5); the eight one-off gems list their own ranges. Nothing else in the file changes.
  • Older configs still load: the old per-rarity rarities: blocks still work, so Main's and Dev's configs need no rewrite.
  • Problems are warned and skipped: an unknown set, bands without stat, a range that isn't min-max, a gem with both shapes (bands win), or a gem with neither. A gem with neither used to break the whole config load.
  • Only the server's own file counts: Bukkit's getConfig() falls back to the bundled config.yml for missing keys. Without this, an older server config would pick up the bundled bands, and in fact empty sections built from them. Dev caught this: the first build loaded every gem with no stats. The second commit fixes it, and a regression test covers it.

Testing

  • Equivalence:
    • Python check: all 40 gems give the same stat and ranges, in the same order, and every other section is identical.
    • Real Java loader: old and new config.yml load the same 160 gem/rarity stat entries (one-off check, not committed).
  • mvn clean verify: all tests pass locally. The new GemStatBandsTest covers named and inline bands, every warning path, the old shape, and the bundled-defaults fallback; it also checks the bundled config gives all 40 gems four bands of one stat with no warnings. The only coverage gaps are the two stores' POSIX-permission tests, which can't run on Windows; Linux CI runs them.
  • TFMCDev01, with the fixed build:
    • Startup with Dev's own old-format config: 40 cutoff lines, the same as 2.4.0, with no warnings.
    • Startup with the same config switched to the compact layout: all 40 cutoff lines identical, no warnings.
    • A bot infused real agates in three rounds with the compact config: 54/54 checks passed (names and stats as expected; band tops and bottoms exact).
    • After restoring Dev's original config and running geminfusion reload: 40 identical lines, no warnings.

🤖 Generated with Claude Code

XxFran10xX and others added 2 commits October 17, 2026 12:44
Each gem now sets its stat once and its range per rarity as one
"min-max" line under bands:, either naming a shared stat-bands set or
listing its own. The 40 bundled gems use five shared sets (tier-1 to
tier-5) and eight inline lists; config.yml drops from 998 to 462 lines
with every stat unchanged. The old rarities: blocks still load, so
existing server configs need no rewrite.

A gem with neither bands nor rarities now logs a warning instead of
breaking the whole config load.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Bukkit's getConfig() falls back to the bundled config.yml for missing
keys. On Dev, an older server config (rarities: blocks) therefore looked
like it had bands, and getConfigurationSection built empty sections from
the bundled ones, so every gem loaded with no stats. parseGem now only
reads keys written in the server's file.

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

coderabbitai Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c1459304-c09b-41dc-a914-44a7bfd8f2bb
  • 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:XL 500-999 effective changed lines (tests excluded in mixed PRs). label Oct 17, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@XxFran10xX
XxFran10xX marked this pull request as ready for review October 17, 2026 11:07
@XxFran10xX

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

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 3e0317c into main Oct 17, 2026
3 of 4 checks passed
@XxFran10xX
XxFran10xX deleted the chore/compact-gem-config branch October 17, 2026 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL 500-999 effective changed lines (tests excluded in mixed PRs).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant