Claude/modernize mininglevels ic tb k#37
Merged
Conversation
- 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
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.