Skip to content

Claude/modernize mininglevels ic tb k#37

Merged
Chafficui merged 7 commits intomasterfrom
claude/modernize-mininglevels-ICTbK
Feb 20, 2026
Merged

Claude/modernize mininglevels ic tb k#37
Chafficui merged 7 commits intomasterfrom
claude/modernize-mininglevels-ICTbK

Conversation

@Chafficui
Copy link
Member

No description provided.

claude and others added 7 commits February 20, 2026 09:18
- MiningLevelTest: 27 → 63 tests (rewards, getName, navigation chains,
  boundary values, single-level edge cases, skill independence)
- MiningPlayerTest: 16 → 48 tests (addRewards, claim, getPlayer,
  getOfflinePlayer, negative XP, stress tests with 100 players)
- MiningBlockTest: 10 → 34 tests (setMaterials, multi-material blocks,
  non-block rejection for tools/items, boundary setMinLevel)
- RewardTest: 3 → 14 tests (round-trip fidelity across 8 materials,
  new instance per call, tools and blocks as rewards)
- MathUtilsTest: 4 → 14 tests (zero/negative/fractional/large ranges,
  distinct values check, ~310 repeated runs total)
- ConfigStringsTest: 6 → 25 tests (exact value checks, format validation,
  distinctness checks for all permissions and message keys)

https://claude.ai/code/session_01EyodQnKSvWcNzA6W8pCmyu
- Bundle default levels.json and blocks.json in src/main/resources/defaults/
  so first-run setup copies from JAR instead of downloading from Google Drive
- Remove dead Google Drive URL constants (DOWNLOAD_URL, MINING_LEVELS_JSON,
  MINING_BLOCKS_JSON) that return 404
- Rewrite FileManager to use getResource() + Files.copy() for defaults
- Guard onDisable() with null check on fileManager to prevent NPE when
  startup fails partway through initialization
- Update installation docs to reflect bundled defaults and data/ directory

Fixes the same class of startup regression reported in MyTrip where
CrucialAPI→CrucialLib migration left dead download URLs that break
first-run bootstrap.

https://claude.ai/code/session_01EyodQnKSvWcNzA6W8pCmyu
Replace placeholder defaults with the actual originals recovered from
the initial commit (2fe705a). The files were removed in 53476af when
Google Drive downloads were introduced.

- levels.json: 10 levels with original XP curve (100→150000)
- blocks.json: 9 block entries with original XP values

Added empty commands[] and rewards[] arrays to levels.json for
compatibility with the reward system added after the initial commit.

https://claude.ai/code/session_01EyodQnKSvWcNzA6W8pCmyu
The bundled defaults (levels.json, blocks.json) were previously untested —
all existing tests construct their own data manually, so wrong default values
went undetected. These 13 tests load the JSON from the classpath and validate
structure, value ranges, material validity, and cross-references between
blocks and levels.

https://claude.ai/code/session_01EyodQnKSvWcNzA6W8pCmyu
25 tests that wire together MiningLevel, MiningBlock, and MiningPlayer using
the actual bundled default configs. Tests cover:
- JSON deserialization into model classes
- Block lookup by material (regular + deepslate variants)
- Level requirement gating (can't mine above your level)
- XP accumulation, level-up thresholds, overflow carry
- Multi-level jumps from large XP gains
- Progressive block unlocks as player levels up
- Full progression from level 1 to max
- Multi-player independence
- Default data cross-reference validity

The core xpChange/levelUp logic is replicated in test helpers because the
actual methods are coupled to the plugin instance and CrucialLib (messaging,
sounds, config), which aren't available in tests.

https://claude.ai/code/session_01EyodQnKSvWcNzA6W8pCmyu
@Chafficui Chafficui merged commit 41d72e0 into master Feb 20, 2026
1 check passed
@Chafficui Chafficui deleted the claude/modernize-mininglevels-ICTbK branch February 20, 2026 11:59
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