Skip to content

Update to Spigot 1.21 + Java 21 and add unit tests#31

Merged
Chafficui merged 5 commits intomasterfrom
claude/modernize-mytrip-plugin-W2wgt
Feb 19, 2026
Merged

Update to Spigot 1.21 + Java 21 and add unit tests#31
Chafficui merged 5 commits intomasterfrom
claude/modernize-mytrip-plugin-W2wgt

Conversation

@Chafficui
Copy link
Copy Markdown
Member

Summary

This PR updates MyTrip to support Spigot 1.21.4 and Java 21, migrates from CrucialAPI to CrucialLib v3.0.0, and establishes a unit test suite with CI/CD integration.

Key Changes

Spigot 1.21 & Java 21 Upgrade

  • Updated Spigot API dependency from 1.20.1 to 1.21.4
  • Updated Java compiler source/target from 14 to 21
  • Updated api-version in plugin.yml from 1.15 to 1.21
  • Fixed deprecated Bukkit API: PotionEffectType.DAMAGE_RESISTANCEPotionEffectType.RESISTANCE in DrugToolEvents.java
  • Updated server compatibility check to include "1.21"

CrucialAPI → CrucialLib Migration

  • Updated all imports from io.github.chafficui.CrucialAPI to io.github.chafficui.CrucialLib
  • Renamed constant CRUCIAL_API_VERSION to CRUCIAL_LIB_VERSION and updated to "3.0.0"
  • Updated Crucial.java to reference CrucialLib in log messages and download URLs (now points to GitHub instead of SpigotMC)
  • Updated Maven repository URLs: added PaperMC repo and changed Spigot repo to public group URL

Unit Test Suite

  • Added JUnit 5 and MockBukkit dependencies
  • Created test classes for utility and API code:
    • ConfigStringsTest: Validates constants, UUIDs, permission formats
    • MathUtilsTest: Tests random number generation with edge cases
    • APICallerTest: Tests event registration/unregistration for all API event types
  • Added maven-surefire-plugin for test execution
  • Created GitHub Actions CI workflow (.github/workflows/ci.yml) that runs on push/PR to master/main branches

Documentation

  • Added ARCHITECTURE.md: Comprehensive overview of plugin structure, data flow, and CrucialLib integration points
  • Added CLAUDE.md: Project overview, dependencies, build instructions, and key classes reference
  • Added CONTRIBUTING.md: Development setup, testing requirements, code style guidelines, and PR checklist
  • Added RUNBOOK.md: Release process, common troubleshooting, and emergency procedures
  • Added DECISIONS/001-spigot-1.21-update.md: Decision record for this upgrade
  • Added DECISIONS/002-add-unit-tests.md: Decision record for test suite implementation

Minor Fixes

  • Fixed .gitignore to use target/ instead of ./target/

Implementation Details

  • All CrucialLib imports are now consistent across the codebase
  • Tests are scoped to test and do not affect production JAR
  • CI pipeline enforces test passage before merge and uploads build artifacts
  • Test coverage focuses on decoupled logic (utilities, API registration); full plugin lifecycle testing deferred pending CrucialLib mock support
  • Documentation provides clear onboarding for contributors and operational runbooks for maintainers

https://claude.ai/code/session_01GGzjtrCV2rjGAue63LD1Rg

- Update Spigot API from 1.20.1 to 1.21.4-R0.1-SNAPSHOT
- Migrate CrucialAPI 2.2.0 to CrucialLib v3.0.0 (new package names)
- Update Java compiler target from 14/16 to 21
- Fix PotionEffectType.DAMAGE_RESISTANCE → RESISTANCE for 1.21 API
- Update plugin.yml api-version to 1.21
- Add JUnit 5 + MockBukkit test suite (107 tests)
- Add GitHub Actions CI workflow (mvn -B verify on Java 21)
- Add CLAUDE.md, ARCHITECTURE.md, CONTRIBUTING.md, RUNBOOK.md
- Add DECISIONS/ directory documenting Spigot 1.21 and test suite decisions

https://claude.ai/code/session_01GGzjtrCV2rjGAue63LD1Rg
Change ./target/ to target/ so the Maven build output directory is
properly excluded from git tracking.

https://claude.ai/code/session_01GGzjtrCV2rjGAue63LD1Rg
Adds actions/upload-artifact step so the plugin JAR can be downloaded
from the workflow run and used for publishing.

https://claude.ai/code/session_01GGzjtrCV2rjGAue63LD1Rg
- Update all version references (Java 21, Spigot 1.21, CrucialLib v3.0.0)
- Fix config key paths to match actual code (addiction_effects, overdose_effects, disable_drug_set)
- Update API docs with CrucialLib import paths
- Add docs/drugs.md covering drug mechanics, consumption flow, addiction system, overdose, and crafting
- Add docs/development.md covering building, testing, CI, project structure, and contributing

https://claude.ai/code/session_01GGzjtrCV2rjGAue63LD1Rg
- Bump version from 0.7.6 to 0.8.0 across pom.xml, all docs, and CLAUDE.md
- Replace verbose CI/CD section in docs/development.md with references to
  existing ci.yml and trigger-docs.yml workflows
- Update claude.md API version to reflect Spigot 1.21+ requirement

https://claude.ai/code/session_01GGzjtrCV2rjGAue63LD1Rg
@Chafficui Chafficui merged commit 96aaa64 into master Feb 19, 2026
2 checks passed
@Chafficui Chafficui deleted the claude/modernize-mytrip-plugin-W2wgt branch February 19, 2026 18:27
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