Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
dec1bf6
chore: add tag release workflows file
walker84837 May 13, 2025
0706973
chore: change types to be more efficient ones
walker84837 May 13, 2025
e681666
chore: update to 1.21.6 and stop using mvn central
walker84837 Jun 30, 2025
415129c
chore: start splitting class into different files
walker84837 Jul 1, 2025
4a30411
refactor: split logic and use ObjectBox for integrated storage
walker84837 Oct 28, 2025
1134730
im told to keep this file by objectbox so ill do it
walker84837 Oct 28, 2025
b963ebd
fix: *sigh* how did I let this happen
walker84837 Oct 28, 2025
3699a39
feat: add kotlinx.serialization for config
walker84837 Oct 28, 2025
96deaa3
chore: implement TLS configuration properly + add Caffeine
walker84837 Dec 23, 2025
69a2a97
chore: separate imports correctly
walker84837 Dec 23, 2025
053af6c
chore: update Gradle to 9.2.0 and plugins used
walker84837 Dec 23, 2025
54f4eaa
refactor: split logic in the main class for modularity
walker84837 Dec 23, 2025
19facef
refactor: move logger to an utility class
walker84837 Dec 23, 2025
db2cc61
chore: add permission descriptions
walker84837 Dec 23, 2025
98136af
chore: remove unused import directives
walker84837 Feb 3, 2026
da8dcf2
refactor!: move related classes into their own modules
walker84837 Feb 4, 2026
c877513
Modify comment for handlePong method
walker84837 Mar 9, 2026
6705c22
Improve error messages for TLS configuration
walker84837 Mar 9, 2026
133c729
feat(protocol): migrate to kotlinx CBOR serialization
walker84837 Mar 11, 2026
d40bd5f
chore: fix some small oversights in moderation structs
walker84837 Mar 11, 2026
8000ab3
feat: use virtual thread executor for client connections
walker84837 Mar 12, 2026
32ccfb5
docs: add TLS keystore guide as it's required by the spec
walker84837 Mar 12, 2026
dc7c91b
fix: use correct linking flow
walker84837 Mar 12, 2026
f18a0f9
feat(protocol): improve packet handling and reconnection
walker84837 Mar 14, 2026
e5cf233
feat: add pre-commit config
walker84837 Mar 14, 2026
1b35b28
refactor(client): use plugin MiniMessage instance
walker84837 Mar 14, 2026
ce64419
chore(tls): switch to PKCS12 keystore and TLS 1.3
walker84837 Mar 14, 2026
00e8329
chore(build): migrate deps to version catalog
walker84837 Mar 14, 2026
051966d
chore: remove unused methods and add docs
walker84837 Mar 14, 2026
8cfec23
chore: add descriptions for each command
walker84837 Mar 14, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Release JAR

on:
push:
tags:
- 'v*.*.*'

permissions:
contents: write

jobs:
release:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '21'

- name: Cache Gradle dependencies
uses: actions/cache@v4
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*','**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-

- name: Build plugin
# Pass the tag name into Gradle as "ver"
run: ./gradlew build -Pver=${{ github.ref_name }}

- name: Run tests
run: ./gradlew test -Pver=${{ github.ref_name }}

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
draft: true
generate_release_notes: true
files: build/libs/*.jar
preserve_order: false
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
36 changes: 33 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,37 @@ The plugin works by generating temporary codes that players can use to authentic
- Download the latest release from the [releases](https://github.com/walker84837/MineChat-Server/releases/latest) page.
- Place the downloaded JAR file into your server's `plugins` directory.

3. **Start Your Server**: Start or restart your Paper server to load the MineChat Server Plugin.
3. **Generate a TLS keystore**:
MineChat requires TLS to be enabled. Generate a self-signed keystore using modern algorithms (EC secp384r1):
```bash
keytool -genkeypair \
-alias minechat \
-keyalg EC \
-keysize 384 \
-storetype PKCS12 \
-keystore keystore.p12 \
-validity 3650 \
-storepass <your-password> \
-keypass <your-password> \
-dname "CN=localhost, OU=Dev, O=MineChat, L=City, ST=State, C=US"
```

4. **Configure TLS**:
- Copy the generated `keystore.p12` to your server's plugin data folder:
```
<server>/plugins/MineChat/keystore.p12
```
- Edit the generated `config.yml` in the plugin folder, or create one with:
```yaml
port: 25575
tls:
enabled: true
keystore: "keystore.p12"
keystore-password: "your-password"
```
- **Note**: The server enforces TLS 1.3 for maximum security.

5. **Start Your Server**: Start or restart your Paper server to load the MineChat Server Plugin.

## Usage

Expand All @@ -42,13 +72,13 @@ The plugin works by generating temporary codes that players can use to authentic

## How it works

- **Initial phase**:
- **Initial phase**:
The plugin opens a server socket on port `25575` to listen for connections from MineChat clients.

- **Authentication**:
- Clients use either a new link code or their stored client UUID to authenticate.
- Successful authentication triggers in-game notifications (join/leave messages) to all players.

- **Message broadcasting**:
- The plugin listens for in-game chat events and broadcasts messages to connected clients.
- Similarly, messages received from clients are broadcast to the Minecraft chat.
Expand Down
59 changes: 41 additions & 18 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
import java.text.SimpleDateFormat
import java.util.*
buildscript {
repositories {
mavenCentral()
maven { url = uri("https://download.objectbox.io/maven") }
}
dependencies {
classpath("io.objectbox:objectbox-gradle-plugin:3.8.0")
}
}

plugins {
id("com.gradleup.shadow") version "8.3.6"
kotlin("jvm") version "2.1.10"
id("com.gradleup.shadow") version "9.3.0"
kotlin("jvm") version "2.3.0"
kotlin("plugin.serialization") version "2.3.0"
}

apply(plugin = "io.objectbox")

group = "org.winlogon.minechat"

fun getLatestGitTag(): String? {
Expand All @@ -20,7 +30,7 @@ fun getLatestGitTag(): String? {
} else {
null
}
} catch (e: Exception) {
} catch (_: Exception) {
null
}
}
Expand Down Expand Up @@ -52,7 +62,6 @@ repositories {
url = uri("https://repo.papermc.io/repository/maven-public/")
content {
includeModule("io.papermc.paper", "paper-api")
includeModule("io.papermc", "paperlib")
includeModule("net.md-5", "bungeecord-chat")
}
}
Expand All @@ -65,22 +74,32 @@ repositories {
}

maven {
url = uri("https://libraries.minecraft.net")
url = uri("https://maven.winlogon.org/releases")
}

mavenCentral()
}

dependencies {
compileOnly("io.papermc.paper:paper-api:1.21.4-R0.1-SNAPSHOT")
compileOnly("net.kyori:adventure-text-serializer-plain:4.19.0")
compileOnly("com.mojang:brigadier:1.1.8")
compileOnly("com.github.ben-manes.caffeine:caffeine:3.2.0")

testRuntimeOnly("org.junit.platform:junit-platform-launcher:1.11.4")
testImplementation("io.papermc.paper:paper-api:1.21.4-R0.1-SNAPSHOT")
testImplementation("org.junit.jupiter:junit-jupiter:5.11.4")
testImplementation("org.jetbrains.kotlin:kotlin-test:2.1.10")
compileOnly(libs.caffeine)
compileOnly(libs.zstd.jni)

compileOnly(libs.objectbox.kotlin)
compileOnly(libs.paper.api)
compileOnly(libs.kotlin.reflect)
compileOnly(libs.asynccraftr)
implementation(libs.kaml)

implementation(libs.jackson.dataformat.cbor)
implementation(libs.jackson.module.kotlin)

implementation(libs.kotlinx.serialization.json)
implementation(libs.kotlinx.serialization.cbor)

testRuntimeOnly(libs.junit.platform.launcher)
testImplementation(libs.paper.api.test)
testImplementation(libs.junit.jupiter)
testImplementation(libs.kotlin.test)
}

tasks.test {
Expand All @@ -104,7 +123,6 @@ tasks.shadowJar {
minimize()
}

// Disable jar and replace with shadowJar
tasks.jar {
enabled = false
}
Expand All @@ -113,7 +131,6 @@ tasks.assemble {
dependsOn(tasks.shadowJar)
}

// Utility tasks
tasks.register("printProjectName") {
doLast {
println(projectName)
Expand All @@ -131,3 +148,9 @@ tasks.register("release") {
}
}
}

tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
compilerOptions {
freeCompilerArgs.add("-Xannotation-default-target=param-property")
}
}
4 changes: 0 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# This file was generated by the Gradle 'init' task.
# https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties

org.gradle.configuration-cache=false
org.gradle.parallel=true
org.gradle.caching=true

31 changes: 29 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,29 @@
# This file was generated by the Gradle 'init' task.
# https://docs.gradle.org/current/userguide/platforms.html#sub::toml-dependencies-format
[versions]
kotlinx-serialization-json = "1.10.0"
kotlinx-serialization-cbor = "1.10.0"
kaml = "0.102.0"
caffeine = "3.2.0"
zstd-jni = "1.5.6-1"
objectbox = "3.8.0"
paper = "1.21.6-R0.1-SNAPSHOT"
kotlin = "2.1.10"
asynccraftr = "0.1.0"
jackson = "2.17.1"
junit = "1.11.4"

[libraries]
caffeine = { module = "com.github.ben-manes.caffeine:caffeine", version.ref = "caffeine" }
zstd-jni = { module = "com.github.luben:zstd-jni", version.ref = "zstd-jni" }
objectbox-kotlin = { module = "io.objectbox:objectbox-kotlin", version.ref = "objectbox" }
paper-api = { module = "io.papermc.paper:paper-api", version.ref = "paper" }
kotlin-reflect = { module = "org.jetbrains.kotlin:kotlin-reflect", version.ref = "kotlin" }
asynccraftr = { module = "org.winlogon:asynccraftr", version.ref = "asynccraftr" }
kaml = { module = "com.charleskorn.kaml:kaml", version.ref = "kaml" }
jackson-dataformat-cbor = { module = "com.fasterxml.jackson.dataformat:jackson-dataformat-cbor", version.ref = "jackson" }
jackson-module-kotlin = { module = "com.fasterxml.jackson.module:jackson-module-kotlin", version.ref = "jackson" }
kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinx-serialization-json" }
kotlinx-serialization-cbor = { module = "org.jetbrains.kotlinx:kotlinx-serialization-cbor", version.ref = "kotlinx-serialization-cbor" }
junit-platform-launcher = { module = "org.junit.platform:junit-platform-launcher", version.ref = "junit" }
paper-api-test = { module = "io.papermc.paper:paper-api", version.ref = "paper" }
junit-jupiter = { module = "org.junit.jupiter:junit-jupiter", version.ref = "junit" }
kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" }
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.0-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
9 changes: 3 additions & 6 deletions gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions gradlew.bat

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading