Skip to content

Commit

Permalink
feat: Use ClopLib, make API multi-platform, remove API v1/v2, better …
Browse files Browse the repository at this point in the history
…configs (#400)

* feat: migrate to ClopLib, deprecate old APIs, bump to v3

* deps: bump cloplib to 1.0-5d7a30d

* fix: implement new ClopLib method

* fix: exception with cancelChunkChange, events registering twice

* deps: bump cloplib to 1.0

* deps: bump runtime dependencies

* refactor: publish platform API modules, refactor stuff into providers

* refactor: more refactor work

* refactor: finish config refactor

* docs: Document new version requirements

* docs: Update docs with new config comments

* docs: Update API compatibility table
  • Loading branch information
WiIIiam278 authored Jan 31, 2024
1 parent 330fa08 commit 988161b
Show file tree
Hide file tree
Showing 116 changed files with 4,032 additions and 7,209 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<img src="https://img.shields.io/github/actions/workflow/status/WiIIiam278/HuskTowns/ci.yml?branch=master&logo=github"/>
</a>
<a href="https://repo.william278.net/#/releases/net/william278/husktowns/">
<img src="https://repo.william278.net/api/badge/latest/releases/net/william278/husktowns?color=00fb9a&name=Maven&prefix=v" />
<img src="https://repo.william278.net/api/badge/latest/releases/net/william278/husktowns/husktowns-common?color=00fb9a&name=Maven&prefix=v" />
</a>
<a href="https://discord.gg/tVYhJfyDWG">
<img src="https://img.shields.io/discord/818135932103557162.svg?label=&logo=discord&logoColor=fff&color=7389D8&labelColor=6A7EC2" />
Expand Down Expand Up @@ -46,7 +46,7 @@ All of this is supported on both standalone setups and across a network of proxi
**Ready?** [Let's head down town!](https://william278.net/docs/husktowns/setup)

## Setup
Requires Java 16+ and a Minecraft 1.16.5+ Spigot-based server. A MySQL database and (optionally) Redis are also needed if you wish to run the plugin across multiple servers on a proxy network.
Requires Java 17+ and a Minecraft 1.17.1+ Spigot-based server. A MySQL database and (optionally) Redis are also needed if you wish to run the plugin across multiple servers on a proxy network.

1. Place the plugin jar file in the `/plugins/` directory of each Spigot server you want to install it on.
2. Start, then stop every server to let HuskTowns generate the config file.
Expand Down
123 changes: 68 additions & 55 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,43 @@ defaultTasks 'licenseFormat', 'build'

ext {
set 'version', version.toString()
set 'description', description.toString()

set 'jedis_version', jedis_version.toString()
set 'mysql_driver_version', mysql_driver_version.toString()
set 'mariadb_driver_version', mariadb_driver_version.toString()
set 'sqlite_driver_version', sqlite_driver_version.toString()
set 'description', description.toString()
}

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 (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)
}
}
}
}
}

allprojects {
Expand All @@ -28,7 +60,7 @@ 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')

Expand Down Expand Up @@ -78,78 +110,59 @@ subprojects {
from '../LICENSE'
}

if (['paper'].contains(project.name)) {
compileJava.options.release.set 17
shadowJar {
destinationDirectory.set(file("$rootDir/target"))
archiveClassifier.set('')
}

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

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

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 (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)
}
}
publishing {
if (['common'].contains(project.name)) {
publications {
mavenJavaCommon(MavenPublication) {
groupId = 'net.william278.husktowns'
artifactId = 'husktowns-common'
version = "$rootProject.version"
artifact shadowJar
artifact sourcesJar
artifact javadocJar
}
}
}

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

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

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


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

@SuppressWarnings('GrMethodMayBeStatic')
Expand Down
14 changes: 10 additions & 4 deletions bukkit/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,33 @@ dependencies {
implementation 'net.kyori:adventure-platform-bukkit:4.3.2'
implementation 'io.papermc:paperlib:1.0.8'
implementation 'space.arim.morepaperlib:morepaperlib:0.4.3'
implementation 'net.william278.cloplib:cloplib-bukkit:1.0.1'
implementation 'me.lucko:commodore:2.2'
implementation 'net.william278:AdvancementAPI:master-SNAPSHOT'
implementation 'org.bstats:bstats-bukkit:3.0.2'

compileOnly 'org.spigotmc:spigot-api:1.16.5-R0.1-SNAPSHOT'
compileOnly 'org.spigotmc:spigot-api:1.17.1-R0.1-SNAPSHOT'
compileOnly 'org.projectlombok:lombok:1.18.30'
compileOnly 'org.jetbrains:annotations:24.1.0'
compileOnly 'com.google.guava:guava:33.0.0-jre'
compileOnly 'de.themoep:minedown-adventure:1.7.2-SNAPSHOT'
compileOnly 'commons-io:commons-io:2.15.1'
compileOnly 'net.william278:annotaml:2.0.7'
compileOnly 'net.william278:huskhomes:4.4.5'
compileOnly 'net.william278:DesertWell:2.0.4'
compileOnly 'com.github.MilkBowl:VaultAPI:1.7.1'
compileOnly 'me.clip:placeholderapi:2.11.5'
compileOnly 'net.luckperms:api:5.4'

testImplementation 'com.github.seeseemelk:MockBukkit-v1.16:1.5.2'
testImplementation 'com.github.seeseemelk:MockBukkit-v1.17:1.12.0'
testImplementation 'de.themoep:minedown-adventure:1.7.2-SNAPSHOT'
testImplementation 'net.kyori:adventure-platform-bukkit:4.3.2'
testImplementation 'org.apache.commons:commons-text:1.11.0'
testImplementation "org.xerial:sqlite-jdbc:$sqlite_driver_version"
testImplementation "com.mysql:mysql-connector-j:$mysql_driver_version"
testImplementation "org.mariadb.jdbc:mariadb-java-client:$mariadb_driver_version"
testImplementation "redis.clients:jedis:$jedis_version"

annotationProcessor 'org.projectlombok:lombok:1.18.30'
}

shadowJar {
Expand All @@ -42,9 +45,10 @@ shadowJar {
relocate 'org.jetbrains', 'net.william278.husktowns.libraries'
relocate 'org.intellij', 'net.william278.husktowns.libraries'
relocate 'com.zaxxer', 'net.william278.husktowns.libraries'
relocate 'net.william278.annotaml', 'net.william278.husktowns.libraries.annotaml'
relocate 'de.exlll', 'net.william278.husktowns.libraries'
relocate 'net.william278.paginedown', 'net.william278.husktowns.libraries.paginedown'
relocate 'net.william278.desertwell', 'net.william278.husktowns.libraries.desertwell'
relocate 'net.william278.cloplib', 'net.william278.husktowns.libraries.cloplib'
relocate 'org.json', 'net.william278.husktowns.libraries.json'
relocate 'dev.dejvokep.boostedyaml', 'net.william278.husktowns.libraries.boostedyaml'
relocate 'org.yaml.snakeyaml', 'net.william278.husktowns.libraries.snakeyaml'
Expand All @@ -56,4 +60,6 @@ shadowJar {
relocate 'space.arim', 'net.william278.husktowns.libraries.paperlib'
relocate 'me.lucko', 'net.william278.husktowns.libraries'
relocate 'net.roxeez', 'net.william278.husktowns.libraries'

minimize()
}
Loading

0 comments on commit 988161b

Please sign in to comment.