Skip to content
This repository has been archived by the owner on Oct 12, 2024. It is now read-only.

Commit

Permalink
v3: New config structure, built-in Velocity packet handling (#196)
Browse files Browse the repository at this point in the history
* build: bump to 2.8

* build: require Java 17, 1.17.1+ on Spigot

* build: publish platform-specific APIs

* build: velocity build pipeline refactor

* refactor: move stuff around, Player -> OnlineUser

* build: minimize jars

* build: update dependabot config

* build: fix version targets in CI flows

* refactor: migrate config files to Exll's configlib

* refactor: more signed chat R&D

* feat: add packet-level chat handling support

* deps: bump ConfigLib to 4.5.0

* feat: add Regex filter, close #188

* deps: bump Spicord

* fix: license headers

* deps: bump ProfanityCheckerAPI to v3.0
  • Loading branch information
WiIIiam278 authored Mar 19, 2024
1 parent 948b630 commit 7d9cba9
Show file tree
Hide file tree
Showing 124 changed files with 3,674 additions and 3,738 deletions.
22 changes: 19 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,23 @@

version: 2
updates:
- package-ecosystem: "gradle" # See documentation for possible values
directory: "/" # Location of package manifests
# CI workflow action updates
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
interval: "weekly"
commit-message:
prefix: "ci"

# Gradle package updates
- package-ecosystem: "gradle"
directory: "/"
schedule:
interval: "weekly"
commit-message:
prefix: "deps"
ignore:
- dependency-name: 'org.spigotmc:spigot-api'
- dependency-name: 'org.papermc:paper-api'
- dependency-name: 'net.md-5:bungeecord-api'
- dependency-name: 'net.dv8tion:JDA'
14 changes: 5 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 16
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '16'
java-version: '17'
distribution: 'temurin'
- name: Install Python
uses: actions/setup-python@v4
Expand Down Expand Up @@ -70,12 +70,6 @@ jobs:
hangar-version-type: Alpha
modrinth-version-type: alpha
game-versions: |
1.16
1.16.1
1.16.2
1.16.3
1.16.4
1.16.5
1.17
1.17.1
1.18
Expand All @@ -89,6 +83,8 @@ jobs:
1.20
1.20.1
1.20.2
1.20.3
1.20.4
modrinth-dependencies: |
unsignedvelocity | suggests | *
signedvelocity | suggests | *
Expand All @@ -100,7 +96,7 @@ jobs:
spigot
paper
folia
java: 16
java: 17
- name: Upload GitHub Artifact
if: success() || failure()
uses: actions/upload-artifact@v2
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pr_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 16
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '16'
java-version: '17'
distribution: 'temurin'
- name: Install Python
uses: actions/setup-python@v4
Expand Down
14 changes: 5 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 16
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '16'
java-version: '17'
distribution: 'temurin'
- name: Install Python
uses: actions/setup-python@v4
Expand Down Expand Up @@ -58,12 +58,6 @@ jobs:
version-type: release
changelog: ${{ github.event.release.body }}
game-versions: |
1.16
1.16.1
1.16.2
1.16.3
1.16.4
1.16.5
1.17
1.17.1
1.18
Expand All @@ -77,6 +71,8 @@ jobs:
1.20
1.20.1
1.20.2
1.20.3
1.20.4
loaders: |
bungeecord
velocity
Expand All @@ -88,7 +84,7 @@ jobs:
signedvelocity | suggests | *
papiproxybridge | suggests | *
placeholderapi | suggests | *
java: 16
java: 17
- name: Upload GitHub Artifact
uses: actions/upload-artifact@v2
if: success() || failure()
Expand Down
15 changes: 6 additions & 9 deletions .github/workflows/update_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,9 @@ jobs:
deploy-wiki:
runs-on: ubuntu-latest
steps:
- name: 'Checkout Code'
uses: actions/checkout@v3
- name: 'Push Changes to Wiki'
uses: Andrew-Chen-Wang/github-wiki-action@v3
env:
WIKI_DIR: 'docs/'
GH_TOKEN: ${{ github.token }}
GH_MAIL: 'actions@github.com'
GH_NAME: 'github-actions[bot]'
- name: 'Checkout for CI 🛎️'
uses: actions/checkout@v4
- name: 'Push Docs to Github Wiki 📄️'
uses: Andrew-Chen-Wang/github-wiki-action@v4
with:
path: 'docs'
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ It's designed to be easy to configure with an elegant out-of-box setup, while al

**⭐ Filters & replacers** — Customisable spam limiting filter, anti-advertising & special emoji

**⭐ Modern formatting** — Utilise modern 1.16+ formatting, with RGB and Gradient support via [MineDown](https://github.com/Phoenix616/MineDown)
**⭐ Modern formatting** — Utilise modern formatting, with RGB and Gradient support via [MineDown](https://github.com/Phoenix616/MineDown)

## Building
To build HuskChat, you'll need python (>=`v3.6`) with associated packages installed; `jep` and `alt-profanity-check`.
Expand Down
145 changes: 98 additions & 47 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ defaultTasks 'licenseFormat', 'build'
ext {
set 'version', version.toString()
set 'description', description.toString()

set 'velocity_api_version', velocity_api_version.toString()
set 'velocity_minimum_build', velocity_minimum_build.toString()
}

allprojects {
Expand All @@ -24,19 +27,29 @@ allprojects {
apply plugin: 'java'

compileJava.options.encoding = 'UTF-8'
compileJava.options.release.set 16
compileJava.options.release.set 17
javadoc.options.encoding = 'UTF-8'
javadoc.options.addStringOption('Xdoclint:none', '-quiet')

repositories {
mavenLocal()
mavenCentral()
maven { url 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/' }
maven { url 'https://repo.velocitypowered.com/snapshots/' }
maven { url 'https://repo.minebench.de/' }
maven { url 'https://repo.wea-ondara.net/repository/public/' }
maven { url 'https://repo.extendedclip.com/content/repositories/placeholderapi/' }
maven { url 'https://jitpack.io' }
maven { url 'https://repo.william278.net/releases/' }
maven { url 'https://mvn-repo.arim.space/lesser-gpl3/' }
maven { url = 'https://repo.william278.net/velocity/' }
maven { url = 'https://repo.codemc.io/repository/maven-releases/' }
maven { url = 'https://repo.william278.net/releases/' }
maven { url = 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/' }
maven { url = 'https://repo.minebench.de/' }
maven { url = 'https://repo.wea-ondara.net/repository/public/' }
maven { url = 'https://repo.extendedclip.com/content/repositories/placeholderapi/' }
maven { url = 'https://jitpack.io' }
maven { url = 'https://mvn-repo.arim.space/lesser-gpl3/' }
}

dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.1'
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.10.1'
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.10.1'
testCompileOnly 'org.jetbrains:annotations:24.1.0'
}

license {
Expand All @@ -45,6 +58,10 @@ allprojects {
newLine = true
}

test {
useJUnitPlatform()
}

processResources {
filesMatching(['**/*.json', '**/*.yml']) {
filter ReplaceTokens as Class, beginToken: '${', endToken: '}',
Expand All @@ -53,70 +70,104 @@ allprojects {
}
}


subprojects {
version rootProject.version
archivesBaseName = "${rootProject.name}-${project.name.capitalize()}"
compileJava.options.encoding = 'UTF-8'

jar {
from '../LICENSE'
}

if (['bungee', 'velocity', 'bukkit', 'plugin'].contains(project.name)) {
shadowJar {
shadowJar {
destinationDirectory.set(file("$rootDir/target"))
archiveClassifier.set('')
}

// API publishing
if (['common','bukkit', 'velocity', 'bungee'].contains(project.name)) {
java {
withSourcesJar()
withJavadocJar()
}
sourcesJar {
destinationDirectory.set(file("$rootDir/target"))
archiveClassifier.set('')
}
javadocJar {
destinationDirectory.set(file("$rootDir/target"))
}
shadowJar.dependsOn(sourcesJar, javadocJar)

jar.dependsOn shadowJar
clean.delete "$rootDir/target"
}

if (['plugin'].contains(project.name)) {
publishing {
repositories {
if (System.getenv("RELEASES_MAVEN_USERNAME") != null) {
maven {
name = "william278-releases"
url = "https://repo.william278.net/releases"
credentials {
username = System.getenv("RELEASES_MAVEN_USERNAME")
password = System.getenv("RELEASES_MAVEN_PASSWORD")
}
authentication {
basic(BasicAuthentication)
}
if (['common'].contains(project.name)) {
publications {
mavenJavaCommon(MavenPublication) {
groupId = 'net.william278.huskchat'
artifactId = 'huskchat-common'
version = "$rootProject.version"
artifact shadowJar
artifact sourcesJar
artifact javadocJar
}
}
}

if (['bukkit'].contains(project.name)) {
publications {
mavenJavaBukkit(MavenPublication) {
groupId = 'net.william278.huskchat'
artifactId = 'huskchat-bukkit'
version = "$rootProject.version"
artifact shadowJar
artifact sourcesJar
artifact javadocJar
}
}
if (System.getenv("SNAPSHOTS_MAVEN_USERNAME") != null) {
maven {
name = "william278-snapshots"
url = "https://repo.william278.net/snapshots"
credentials {
username = System.getenv("SNAPSHOTS_MAVEN_USERNAME")
password = System.getenv("SNAPSHOTS_MAVEN_PASSWORD")
}
authentication {
basic(BasicAuthentication)
}
}

if (['velocity'].contains(project.name)) {
publications {
mavenJavaVelocity(MavenPublication) {
groupId = 'net.william278.huskchat'
artifactId = 'huskchat-velocity'
version = "$rootProject.version"
artifact shadowJar
artifact sourcesJar
artifact javadocJar
}
}
}

publications {
mavenJava(MavenPublication) {
groupId = 'net.william278'
artifactId = "huskchat"
version = "$rootProject.version"
artifact shadowJar
if (['bungee'].contains(project.name)) {
publications {
mavenJavaBungee(MavenPublication) {
groupId = 'net.william278.huskchat'
artifactId = 'huskchat-bungee'
version = "$rootProject.version"
artifact shadowJar
artifact sourcesJar
artifact javadocJar
}
}
}
}
}

jar.dependsOn shadowJar
clean.delete "$rootDir/target"
}


logger.lifecycle("Building HuskChat ${version} by William278")

java {
def javaVersion = JavaVersion.toVersion(javaVersion)
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
withSourcesJar()
withJavadocJar()
}

@SuppressWarnings('GrMethodMayBeStatic')
def versionMetadata() {
// Get if there is a tag for this commit
Expand Down
10 changes: 7 additions & 3 deletions bukkit/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ dependencies {
implementation 'net.kyori:adventure-platform-bukkit:4.3.1'
implementation 'space.arim.morepaperlib:morepaperlib:0.4.3'

compileOnly 'org.spigotmc:spigot-api:1.16.5-R0.1-SNAPSHOT'
compileOnly 'commons-io:commons-io:2.15.0'
compileOnly 'dev.dejvokep:boosted-yaml:1.3.1'
compileOnly 'org.spigotmc:spigot-api:1.17.1-R0.1-SNAPSHOT'
compileOnly 'commons-io:commons-io:2.15.1'
compileOnly 'de.themoep:minedown-adventure:1.7.2-SNAPSHOT'
compileOnly 'me.clip:placeholderapi:2.11.5'
compileOnly 'org.jetbrains:annotations:24.1.0'
compileOnly 'org.projectlombok:lombok:1.18.30'

annotationProcessor 'org.projectlombok:lombok:1.18.30'
}

shadowJar {
Expand All @@ -30,4 +32,6 @@ shadowJar {
//noinspection GroovyAssignabilityCheck
exclude dependency(':slf4j-api')
}

minimize()
}
Loading

0 comments on commit 7d9cba9

Please sign in to comment.