diff options
| -rw-r--r-- | .github/workflows/release.yaml | 24 | ||||
| -rw-r--r-- | CHANGELOG.md | 6 | ||||
| -rw-r--r-- | CLAUDE.md | 93 | ||||
| -rw-r--r-- | build.gradle.kts | 2 |
4 files changed, 104 insertions, 21 deletions
diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index b675d07..e15d426 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -12,7 +12,6 @@ jobs: version: ${{ steps.get_version.outputs.version }} paper_jar_name: ${{ steps.get_version.outputs.paper_jar_name }} velocity_jar_name: ${{ steps.get_version.outputs.velocity_jar_name }} - folia_jar_name: ${{ steps.get_version.outputs.folia_jar_name }} steps: - name: Checkout repository uses: actions/checkout@v6 @@ -24,7 +23,6 @@ jobs: echo "version=$VERSION" >> $GITHUB_OUTPUT echo "paper_jar_name=LunaticChat-$VERSION.jar" >> $GITHUB_OUTPUT echo "velocity_jar_name=LunaticChat-$VERSION-velocity.jar" >> $GITHUB_OUTPUT - echo "folia_jar_name=LunaticChat-$VERSION.jar" >> $GITHUB_OUTPUT echo "Extracted version: $VERSION" - name: Validate tag matches version @@ -115,34 +113,20 @@ jobs: --draft \ --notes "" - - name: Publish to Modrinth (Paper) + - name: Publish to Modrinth (Paper/Folia) uses: cloudnode-pro/modrinth-publish@482deb71067c5207ce5ba263de0c36968d5c2b7b # v2 with: token: ${{ secrets.MODRINTH_TOKEN }} - name: v${{ needs.validate.outputs.version }} (Paper v${{ env.MODRINTH_MC_VERSION }}) + name: v${{ needs.validate.outputs.version }} (Paper/Folia v${{ env.MODRINTH_MC_VERSION }}) project: ${{ secrets.MODRINTH_PROJECT_ID }} - version: ${{ needs.validate.outputs.version }}-paper + version: ${{ needs.validate.outputs.version }} channel: ${{ env.MODRINTH_CHANNEL }} changelog: |- Please refer to the [GitHub release](https://github.com/m1sk9/LunaticChat/releases/tag/v${{ needs.validate.outputs.version }}) for update details. - loaders: paper + loaders: paper, folia game-versions: ${{ env.MODRINTH_GAME_VERSIONS }} files: platform-paper/build/libs/${{ needs.validate.outputs.paper_jar_name }} - - name: Publish to Modrinth (Folia) - uses: cloudnode-pro/modrinth-publish@482deb71067c5207ce5ba263de0c36968d5c2b7b # v2 - with: - token: ${{ secrets.MODRINTH_TOKEN }} - name: v${{ needs.validate.outputs.version }} (Folia v${{ env.MODRINTH_MC_VERSION }}) - project: ${{ secrets.MODRINTH_PROJECT_ID }} - version: ${{ needs.validate.outputs.version }}-folia - channel: ${{ env.MODRINTH_CHANNEL }} - changelog: |- - Please refer to the [GitHub release](https://github.com/m1sk9/LunaticChat/releases/tag/v${{ needs.validate.outputs.version }}) for update details. - loaders: folia - game-versions: ${{ env.MODRINTH_GAME_VERSIONS }} - files: platform-paper/build/libs/${{ needs.validate.outputs.folia_jar_name }} - - name: Publish to Modrinth (Velocity) uses: cloudnode-pro/modrinth-publish@482deb71067c5207ce5ba263de0c36968d5c2b7b # v2 with: diff --git a/CHANGELOG.md b/CHANGELOG.md index dc86989..bf22270 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ ## v0 +### v0.10.1 + +- Codecov was introduced to expand test coverage. +- The release steps for Paper and Folia in Modrinth were consolidated. + - This is because both loaders use the same build, eliminating the need for separate steps. The v0.10.0 release was merged on 2026/02/26 1:00 (UTC+9). + ### v0.10.0 - Added support for Folia 1.21 and later. diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..ced717b --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,93 @@ +# CLAUDE.md + +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. + +## Project Overview + +LunaticChat is a Minecraft chat plugin supporting Paper, Folia, and Velocity servers. It provides direct messaging, channel chat, romaji-to-Japanese conversion, and cross-server global chat via Velocity proxy. + +- **Language**: Kotlin (JVM 21) +- **Build**: Gradle 9+ with Kotlin DSL +- **Tooling**: mise (Java zulu-21, Bun 1.3.9) + +## Common Commands + +### Build +```bash +./gradlew clean build # Full build +./gradlew :platform-paper:shadowJar # Paper/Folia plugin JAR +./gradlew :platform-velocity:shadowJar # Velocity plugin JAR +``` + +### Test +```bash +./gradlew test # Run all tests +./gradlew :engine:test # Run engine tests only +./gradlew :platform-paper:test # Run paper tests only +./gradlew :platform-paper:test --tests "*ChannelManagerTest" # Single test class +``` + +### Lint +```bash +./gradlew ktlintCheck # Check style +./gradlew ktlintFormat # Auto-format +``` + +### Debug Server (Docker) +```bash +./x start # Velocity + 2 Paper servers +./x folia start # Single Folia server +./x rcon s1 # RCON console to Paper s1 +./x help # All available commands +``` + +## Architecture + +### Module Structure + +``` +engine/ → Platform-agnostic core (models, converters, protocol, exceptions) +platform-paper/ → Paper & Folia plugin (commands, listeners, config, services) +platform-velocity/ → Velocity proxy plugin (message relay between servers) +dokka/ → API documentation aggregator (no Kotlin source) +docs/ → VitePress documentation site +``` + +**Dependency flow**: `platform-paper` and `platform-velocity` both depend on `engine`. The engine has no Minecraft platform dependencies. + +### Key Architectural Patterns + +**Service Container** (`platform-paper`): All services are held in an immutable `ServiceContainer` data class. `ServiceInitializer` handles initialization order and conditional feature setup. Optional features (channel chat, Velocity integration, Japanese conversion) are nullable fields. + +**Feature Gating**: Features are toggled via `config.yml`. The `ServiceInitializer` conditionally creates services based on config, and the `ServiceContainer` holds them as nullable properties. + +**Plugin Messaging Protocol**: Cross-server communication uses a custom `PluginMessageCodec` in the engine module. Paper servers encode/decode messages via this codec, and Velocity relays them between servers. + +### Key Packages (engine) + +| Package | Purpose | +|---------|---------| +| `chat.channel` | Channel data model and validation | +| `converter` | Google IME API client for romaji conversion | +| `exception` | Custom exception hierarchy (23 types) | +| `protocol` | Plugin messaging codec for Velocity communication | +| `settings` | Player settings models with UUID serialization | + +### Key Packages (platform-paper) + +| Package | Purpose | +|---------|---------| +| `chat.handler` | DirectMessage, ChannelMessage, ChannelNotification handlers | +| `command` | Command registration and execution | +| `config` | YAML config loading via KAML | +| `i18n` | Language support (EN, JA) | +| `listener` | Event listeners (chat, join/quit, plugin messages) | +| `velocity` | Cross-server integration | + +## Code Conventions + +- Follows [Kotlin Coding Conventions](https://kotlinlang.org/docs/coding-conventions.html), enforced by Ktlint +- PRs must pass `./gradlew ktlintCheck` +- Tests use JUnit 5 + MockK; coroutine tests use `kotlinx-coroutines-test` +- Shadow JAR output: `LunaticChat-{version}.jar` (Paper), `LunaticChat-{version}-velocity.jar` (Velocity) +- Serialization uses kotlinx-serialization with KAML for YAML config files diff --git a/build.gradle.kts b/build.gradle.kts index d2bd265..b20a6b3 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -14,7 +14,7 @@ plugins { allprojects { group = "dev.m1sk9" - version = "0.10.0" + version = "0.10.1" repositories { mavenCentral() |
