Upgrade to Paper 1.21, Java 21, and add comprehensive unit tests#34
Merged
Upgrade to Paper 1.21, Java 21, and add comprehensive unit tests#34
Conversation
- Migrate from Spigot API to Paper API 1.21, Java 21 - Migrate CrucialAPI 2.1.7 → CrucialLib 3.0.0 (package rename + API updates) - Fix deprecated APIs: PotionEffectType.HASTE, URI.create().toURL() - Add lazy plugin initialization for testability - Add 184 unit tests (JUnit 5 + MockBukkit 4.x) - Add CI workflow (.github/workflows/ci.yml) - Update existing maven.yml to Java 21 + actions v4 - Add CLAUDE.md, ARCHITECTURE.md, CONTRIBUTING.md, RUNBOOK.md - Add DECISIONS/ with ADR-001 (Spigot 1.21 update) and ADR-002 (unit tests) https://claude.ai/code/session_01EyodQnKSvWcNzA6W8pCmyu
- Remove maven.yml (duplicated by ci.yml) - Bump version from 1.2.10 to 2.0.0 in pom.xml - Update claude.md with current versions and dependencies 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.
Summary
This PR modernizes MiningLevels to target Paper 1.21 and Java 21, migrates from CrucialAPI 2.1.7 to CrucialLib 3.0.0, and introduces comprehensive unit test coverage for the core API and utilities.
Key Changes
Platform & Dependency Updates
io.github.chafficui.CrucialAPItoio.github.chafficui.CrucialLib(package rename in v3.0.0)api-versionfrom1.15to1.21and softdepend fromCrucialAPItoCrucialLibUnit Tests (New)
Added comprehensive test suite with 100+ test cases covering:
All tests use JUnit 5 with MockBukkit 4.101.0 for Bukkit API mocking (Materials, ItemStacks, etc.).
CI/CD
.github/workflows/maven.ymlwith new.github/workflows/ci.ymlDocumentation (New)
Code Improvements
Implementation Details
MockBukkit.mock()only (notMockBukkit.load()) to avoid plugin lifecycle initialization that requires CrucialLib at runtimeMiningLevel.miningLevels,MiningBlock.miningBlocks,MiningPlayer.miningPlayers) are cleared in@BeforeEachfor test isolation<Class>Testwith descriptive test method names (methodName_condition_expectedBehavior)mvn clean verifyto compile, test, and package in one stepBreaking Changes
None for end users. The plugin API remains compatible; only internal dependency versions have changed.
https://claude.ai/code/session_01EyodQnKSvWcNzA6W8pCmyu