From f8ad215b7624409d5262f9ecf97e77900cc297bc Mon Sep 17 00:00:00 2001 From: William Date: Mon, 12 Feb 2024 11:18:50 +0000 Subject: [PATCH] refactor: Fabric 1.20.4, Sponge API v10, Java 17, Platform APIs (#562) * deps: bump dependencies * refactor: bukkit 1.17.1, Sponge v10, fabric 1.20.4 * refactor: release platform-specific API modules * fix: checkstyle javadoc comment * docs: update API docs * docs: mention API platforms in events api docs --- .github/workflows/ci.yml | 15 +- .github/workflows/release.yml | 15 +- README.md | 2 +- build.gradle | 159 +++++++++++------- bukkit/build.gradle | 12 +- .../william278/huskhomes/BukkitHuskHomes.java | 6 +- .../huskhomes/api/HuskHomesAPI.java | 16 +- bukkit/src/main/resources/plugin.yml | 2 +- .../huskhomes/BukkitPluginTests.java | 4 +- .../huskhomes/api/BaseHuskHomesAPI.java | 33 +++- docs/API-Events.md | 2 + docs/API.md | 33 +++- docs/Setup.md | 4 +- docs/Unsupported-Versions.md | 1 + .../william278/huskhomes/user/FabricUser.java | 2 +- gradle.properties | 27 ++- gradle/wrapper/gradle-wrapper.jar | Bin 61608 -> 62076 bytes gradle/wrapper/gradle-wrapper.properties | 2 +- gradlew | 7 +- paper/build.gradle | 4 +- plugin/build.gradle | 4 - settings.gradle | 1 - sponge/build.gradle | 2 +- .../huskhomes/util/SpongeAdapter.java | 21 ++- 24 files changed, 221 insertions(+), 153 deletions(-) delete mode 100644 plugin/build.gradle diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1e7840abf..e868a9c9e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -57,7 +57,7 @@ jobs: hangar-id: William278/HuskHomes hangar-token: ${{ secrets.HANGAR_API_KEY }} hangar-version-type: Alpha - files-primary: target/HuskHomes-Plugin-*.jar + files-primary: target/HuskHomes-Paper-*.jar name: HuskHomes (Spigot) v${{ env.version_name }} version: ${{ env.version_name }} version-type: alpha @@ -67,12 +67,11 @@ jobs: paper folia game-versions: | - 1.16.5 1.17.1 1.18.2 1.19.4 - 1.20.2 - java: 16 + 1.20.4 + java: 17 - name: 'Sponge: Publish to Modrinth 🧽' uses: WiIIiam278/mc-publish@hangar if: success() || failure() @@ -91,8 +90,8 @@ jobs: loaders: | sponge game-versions: | - 1.16.5 - java: 16 + 1.19.4 + java: 17 - name: 'Fabric: Publish to Modrinth & CurseForge 🧵' uses: WiIIiam278/mc-publish@hangar if: success() || failure() @@ -117,7 +116,7 @@ jobs: loaders: | fabric game-versions: | - 1.20.2 + 1.20.4 java: 17 - name: 'Upload GitHub Artifacts 📦' uses: actions/upload-artifact@v4 @@ -125,6 +124,6 @@ jobs: with: name: HuskHomes path: | - target/HuskHomes-Plugin-*.jar + target/HuskHomes-Paper-*.jar target/HuskHomes-Sponge-*.jar target/HuskHomes-Fabric-*.jar \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f30857891..ea64c100c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -45,7 +45,7 @@ jobs: plan | suggests | * hangar-id: William278/HuskHomes hangar-token: ${{ secrets.HANGAR_API_KEY }} - files-primary: target/HuskHomes-Plugin-*.jar + files-primary: target/HuskHomes-Paper-*.jar name: HuskHomes (Spigot) v${{ github.event.release.tag_name }} version: ${{ github.event.release.tag_name }} version-type: release @@ -55,12 +55,11 @@ jobs: paper folia game-versions: | - 1.16.5 1.17.1 1.18.2 1.19.4 - 1.20.2 - java: 16 + 1.20.4 + java: 17 - name: 'Sponge: Publish to Modrinth 🧽' uses: WiIIiam278/mc-publish@hangar with: @@ -78,8 +77,8 @@ jobs: loaders: | sponge game-versions: | - 1.16.5 - java: 16 + 1.19.4 + java: 17 - name: 'Fabric: Publish to Modrinth & CurseForge 🧵' uses: WiIIiam278/mc-publish@hangar with: @@ -103,13 +102,13 @@ jobs: loaders: | fabric game-versions: | - 1.20.2 + 1.20.4 java: 17 - name: 'Upload GitHub Artifacts 📦' uses: actions/upload-artifact@v4 with: name: HuskHomes path: | - target/HuskHomes-Plugin-*.jar + target/HuskHomes-Paper-*.jar target/HuskHomes-Sponge-*.jar target/HuskHomes-Fabric-*.jar \ No newline at end of file diff --git a/README.md b/README.md index 6642223ea..06783cd76 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ - + diff --git a/build.gradle b/build.gradle index 59f0d513f..8d4628e2e 100644 --- a/build.gradle +++ b/build.gradle @@ -24,6 +24,37 @@ ext { set 'mariadb_driver_version', mariadb_driver_version.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 { apply plugin: 'com.github.johnrengelman.shadow' apply plugin: 'org.cadixdev.licenser' @@ -31,7 +62,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') @@ -59,9 +90,9 @@ allprojects { } 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' + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.2' + testImplementation 'org.junit.jupiter:junit-jupiter-params:5.10.2' + testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.10.2' } license { @@ -74,97 +105,102 @@ allprojects { toolVersion = '10.12.0' } + test { + useJUnitPlatform() + } + processResources { filesMatching(['**/*.json', '**/*.yml']) { filter ReplaceTokens as Class, beginToken: '${', endToken: '}', tokens: rootProject.ext.properties } } - } subprojects { version rootProject.version archivesBaseName = "${rootProject.name}-${project.name.capitalize()}" - compileJava.options.encoding = 'UTF-8' jar { from '../LICENSE' } - test { - useJUnitPlatform() - } - - if (['paper', 'fabric'].contains(project.name)) { - compileJava.options.release.set 17 + shadowJar { + destinationDirectory.set(file("$rootDir/target")) + archiveClassifier.set('') } - if (['bukkit', 'paper', 'plugin', 'fabric', 'sponge'].contains(project.name)) { - shadowJar { + // API publishing + if (['common', 'bukkit', 'fabric', 'sponge'].contains(project.name)) { + java { + withSourcesJar() + withJavadocJar() + } + sourcesJar { + destinationDirectory.set(file("$rootDir/target")) + } + javadocJar { destinationDirectory.set(file("$rootDir/target")) - archiveClassifier.set('') } + shadowJar.dependsOn(sourcesJar, javadocJar) - 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) - } - } + publishing { + if (['common'].contains(project.name)) { + publications { + mavenJavaCommon(MavenPublication) { + groupId = 'net.william278.huskhomes' + artifactId = 'huskhomes-common' + 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 (['bukkit'].contains(project.name)) { + publications { + mavenJavaBukkit(MavenPublication) { + groupId = 'net.william278.huskhomes' + artifactId = 'huskhomes-bukkit' + version = "$rootProject.version" + artifact shadowJar + artifact sourcesJar + artifact javadocJar } } + } + if (['fabric'].contains(project.name)) { publications { - mavenJava(MavenPublication) { - groupId = 'net.william278' - artifactId = 'huskhomes' + mavenJavaBukkit(MavenPublication) { + groupId = 'net.william278.huskhomes' + artifactId = 'huskhomes-fabric' version = "$rootProject.version" artifact shadowJar + artifact sourcesJar artifact javadocJar + } + } + } + + if (['sponge'].contains(project.name)) { + publications { + mavenJavaBukkit(MavenPublication) { + groupId = 'net.william278.huskhomes' + artifactId = 'huskhomes-sponge' + version = "$rootProject.version" + artifact shadowJar artifact sourcesJar + artifact javadocJar } } } } - - jar.dependsOn shadowJar - clean.delete "$rootDir/target" } + + jar.dependsOn shadowJar + clean.delete "$rootDir/target" } logger.lifecycle("Building HuskHomes ${version} by William278") @@ -182,5 +218,4 @@ def versionMetadata() { return '-' + System.getenv("GITHUB_RUN_NUMBER") ? 'build.' + System.getenv("GITHUB_RUN_NUMBER") : 'unknown' } return '-' + grgit.head().abbreviatedId + (grgit.status().clean ? '' : '-indev') -} - +} \ No newline at end of file diff --git a/bukkit/build.gradle b/bukkit/build.gradle index 413fc4b9d..498eaabe3 100644 --- a/bukkit/build.gradle +++ b/bukkit/build.gradle @@ -7,7 +7,7 @@ dependencies { implementation 'me.lucko:commodore:2.2' implementation 'net.kyori:adventure-platform-bukkit:4.3.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.jetbrains:annotations:24.1.0' compileOnly 'de.themoep:minedown-adventure:1.7.2-SNAPSHOT' compileOnly 'net.william278:annotaml:2.0.5' @@ -18,13 +18,13 @@ dependencies { exclude group: 'org.spigotmc', module: 'spigot-api' } - testImplementation 'com.github.seeseemelk:MockBukkit-v1.16:1.5.2' + testImplementation 'com.github.seeseemelk:MockBukkit-v1.17:1.13.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 'redis.clients:jedis:' + jedis_version - testImplementation 'org.xerial:sqlite-jdbc:' + sqlite_driver_version - testImplementation 'com.mysql:mysql-connector-j:' + mysql_driver_version + testImplementation "redis.clients:jedis:${jedis_version}" + testImplementation "org.xerial:sqlite-jdbc:${sqlite_driver_version}" + testImplementation "com.mysql:mysql-connector-j:${mysql_driver_version}" } shadowJar { @@ -50,4 +50,6 @@ shadowJar { relocate 'io.papermc.lib', 'net.william278.huskhomes.libraries.paperlib' relocate 'space.arim.morepaperlib', 'net.william278.huskhomes.libraries.paperlib' relocate 'me.lucko.commodore', 'net.william278.huskhomes.libraries.commodore' + + minimize() } \ No newline at end of file diff --git a/bukkit/src/main/java/net/william278/huskhomes/BukkitHuskHomes.java b/bukkit/src/main/java/net/william278/huskhomes/BukkitHuskHomes.java index f8140bbec..a88e553bf 100644 --- a/bukkit/src/main/java/net/william278/huskhomes/BukkitHuskHomes.java +++ b/bukkit/src/main/java/net/william278/huskhomes/BukkitHuskHomes.java @@ -230,6 +230,7 @@ public boolean isDependencyLoaded(@NotNull String name) { @Override public void onDisable() { + HuskHomesAPI.unregister(); if (this.eventListener != null) { this.eventListener.handlePluginDisable(); } @@ -483,11 +484,6 @@ && getSettings().getBrokerType() == Broker.Type.PLUGIN_MESSAGE) { } } - @NotNull - public AudienceProvider getAudiences() { - return audiences; - } - @NotNull public GracefulScheduling getScheduler() { return paperLib.scheduling(); diff --git a/bukkit/src/main/java/net/william278/huskhomes/api/HuskHomesAPI.java b/bukkit/src/main/java/net/william278/huskhomes/api/HuskHomesAPI.java index fed4b34bc..57511a7d6 100644 --- a/bukkit/src/main/java/net/william278/huskhomes/api/HuskHomesAPI.java +++ b/bukkit/src/main/java/net/william278/huskhomes/api/HuskHomesAPI.java @@ -43,9 +43,6 @@ @SuppressWarnings("unused") public class HuskHomesAPI extends BaseHuskHomesAPI { - // Instance of the plugin - private static HuskHomesAPI instance; - /** * (Internal use only) - Constructor, instantiating the API. */ @@ -62,10 +59,7 @@ private HuskHomesAPI(@NotNull BukkitHuskHomes plugin) { */ @NotNull public static HuskHomesAPI getInstance() throws NotRegisteredException { - if (instance == null) { - throw new NotRegisteredException(); - } - return instance; + return (HuskHomesAPI) BaseHuskHomesAPI.getInstance(); } /** @@ -78,14 +72,6 @@ public static void register(@NotNull BukkitHuskHomes plugin) { instance = new HuskHomesAPI(plugin); } - /** - * (Internal use only) - Unregister the API for this platform. - */ - @ApiStatus.Internal - public static void unregister() { - instance = null; - } - /** * Returns an {@link OnlineUser} instance for the given bukkit {@link Player}. * diff --git a/bukkit/src/main/resources/plugin.yml b/bukkit/src/main/resources/plugin.yml index 2315141dd..210092ab3 100644 --- a/bukkit/src/main/resources/plugin.yml +++ b/bukkit/src/main/resources/plugin.yml @@ -4,7 +4,7 @@ author: 'William278' website: 'https://william278.net/' main: 'net.william278.huskhomes.BukkitHuskHomes' version: '${version}' -api-version: '1.16' +api-version: '1.17' softdepend: - Vault - PlaceholderAPI diff --git a/bukkit/src/test/java/net/william278/huskhomes/BukkitPluginTests.java b/bukkit/src/test/java/net/william278/huskhomes/BukkitPluginTests.java index b8b386d26..b8d552eaa 100644 --- a/bukkit/src/test/java/net/william278/huskhomes/BukkitPluginTests.java +++ b/bukkit/src/test/java/net/william278/huskhomes/BukkitPluginTests.java @@ -48,9 +48,9 @@ import java.util.stream.Stream; /** - * Uses MockBukkit to test the plugin on a mock Paper server implementing the Bukkit 1.16 API. + * Uses MockBukkit to test the plugin on a mock Paper server implementing the Bukkit 1.17 API. */ -@DisplayName("Bukkit Plugin Tests (1.16.5)") +@DisplayName("Bukkit Plugin Tests (1.17.1)") public class BukkitPluginTests { private static ServerMock server; diff --git a/common/src/main/java/net/william278/huskhomes/api/BaseHuskHomesAPI.java b/common/src/main/java/net/william278/huskhomes/api/BaseHuskHomesAPI.java index 20101da11..4dee95285 100644 --- a/common/src/main/java/net/william278/huskhomes/api/BaseHuskHomesAPI.java +++ b/common/src/main/java/net/william278/huskhomes/api/BaseHuskHomesAPI.java @@ -52,8 +52,12 @@ * This class should not be used directly, but rather through platform-specific extending API classes. */ @SuppressWarnings("unused") -public abstract class BaseHuskHomesAPI { +public class BaseHuskHomesAPI { + /** + * (Internal use only) - API instance. + */ + protected static BaseHuskHomesAPI instance; /** * (Internal use only) - Instance of the implementing plugin. */ @@ -834,10 +838,35 @@ public final Optional getRawLocale(@NotNull String localeKey, @NotNull S return plugin.getLocales().getRawLocale(localeKey, replacements); } + /** + * Get an instance of the HuskHomes API. + * + * @return instance of the HuskHomes API + * @throws NotRegisteredException if the API has not yet been registered. + * @since 1.0 + */ + @NotNull + public static BaseHuskHomesAPI getInstance() throws NotRegisteredException { + if (instance == null) { + throw new NotRegisteredException(); + } + return instance; + } + + /** + * (Internal use only) - Unregister the API instance. + * + * @since 1.0 + */ + @ApiStatus.Internal + public static void unregister() { + instance = null; + } + /** * An exception indicating the plugin has been accessed before it has been registered. */ - static final class NotRegisteredException extends IllegalStateException { + public static final class NotRegisteredException extends IllegalStateException { private static final String MESSAGE = """ Could not access the HuskHomes API as it has not yet been registered. This could be because: diff --git a/docs/API-Events.md b/docs/API-Events.md index 0ce4b8d29..934bb4710 100644 --- a/docs/API-Events.md +++ b/docs/API-Events.md @@ -24,6 +24,8 @@ HuskHomes provides a number of API events your plugin can listen to when certain ‡ Called on the server the player *is teleported from*; not necessarily where the executor of the teleport is. ## Events on Sponge & Fabric +> **Note:** Check the [[API]] introduction for details on targeting platforms + Sponge, which has a similar Event api as Bukkit, has equivalent events for all of the above, prefixed with `Sponge` (so HomeCreateEvent on Bukkit is SpongeHomeCreateEvent on Sponge). Fabric uses callbacks for handling events. HuskHomes provides callback equivalents for all the above events. For instance, to handle what to do when someone creates a home, you can register a callback to handle what to do as follows: diff --git a/docs/API.md b/docs/API.md index 13864453c..1d79eb11c 100644 --- a/docs/API.md +++ b/docs/API.md @@ -3,7 +3,7 @@ The HuskHomes API provides methods for getting, editing and updating user homes The API is distributed on Maven through [repo.william278.net](https://repo.william278.net/#/releases/net/william278/huskhomes/) and can be included in any Maven, Gradle, etc. project. JavaDocs are [available here](https://repo.william278.net/javadoc/releases/net/william278/huskhomes/latest). ## Compatibility -[![Maven](https://repo.william278.net/api/badge/latest/releases/net/william278/huskhomes?color=00fb9a&name=Maven&prefix=v)](https://repo.william278.net/#/releases/net/william278/huskhomes/) +[![Maven](https://repo.william278.net/api/badge/latest/releases/net/william278/huskhomes/huskhomes-common?color=00fb9a&name=Maven&prefix=v)](https://repo.william278.net/#/releases/net/william278/huskhomes/) The HuskHomes API shares version numbering with the plugin itself for consistency and convenience. Please note minor and patch plugin releases may make API additions and deprecations, but will not introduce breaking changes without notice. @@ -14,18 +14,33 @@ The HuskHomes API shares version numbering with the plugin itself for consistenc | v2.x | _v2.0—v2.11.2_ | ❌ | | v1.x | _v1.5—v1.5.11_ | ❌ | +### Platforms +> **Note:** For versions older than `v4.6`, the HuskHomes API was only distributed for the Bukkit platform (as `net.william278:huskhomes`) + +The HuskHomes API is available for the following platforms: + +* `bukkit` - Bukkit, Spigot, Paper, etc. Provides Bukkit API events and extends `BaseHuskHomesAPI` with `org.bukkit` adapters. +* `fabric` - Fabric, Quilt, etc. Provides Fabric callback-style listeners +* `sponge` - Sponge. Provides Sponge API events. +* `common` - Common API for all platforms. +
Targeting older versions -HuskHomes versions prior to `v4.3.1` are distributed on [JitPack](https://jitpack.io/#net.william278/HuskHomes2), and you will need to use the `https://jitpack.io` repository instead. +* The HuskHomes API was only distributed for the Bukkit module prior to `v4.6`; the artifact ID was `net.william278:huskhomes` instead of `net.william278.huskhomes:huskhomes-PLATFORM`. +* HuskHomes versions prior to `v4.3.1` are distributed on [JitPack](https://jitpack.io/#net.william278/HuskHomes2), and you will need to use the `https://jitpack.io` repository instead.
## Table of contents -1. Adding the API to your project -2. Adding HuskHomes as a dependency -3. Next steps +1. [API Introduction](#1-api-introduction) + 1. [Setup with Maven](#11-setup-with-maven) + 2. [Setup with Gradle](#12-setup-with-gradle) + 3. [Next steps](#3-next-steps) +2. [Adding HuskHomes as a dependency](#2-adding-huskhomes-as-a-dependency) +3. [Next steps](#3-next-steps) + +## 1 API Introduction -## API Introduction ### 1.1 Setup with Maven
Maven setup information @@ -42,8 +57,8 @@ Add the repository to your `pom.xml` as per below. You can alternatively specify Add the dependency to your `pom.xml` as per below. Replace `VERSION` with the latest version of HuskHomes (without the v): ![Latest version](https://img.shields.io/github/v/tag/WiIIiam278/HuskHomes?color=%23282828&label=%20&style=flat-square) ```xml - net.william278 - huskhomes + net.william278.huskhomes + huskhomes-PLATFORM VERSION provided @@ -66,7 +81,7 @@ Add the dependency as per below. Replace `VERSION` with the latest version of Hu ```groovy dependencies { - compileOnly 'net.william278:huskhomes:VERSION' + compileOnly 'net.william278.huskhomes:huskhomes-PLATFORM:VERSION' } ```
diff --git a/docs/Setup.md b/docs/Setup.md index eeda62b64..4325bc39f 100644 --- a/docs/Setup.md +++ b/docs/Setup.md @@ -3,13 +3,13 @@ This will walk you through installing HuskHomes on your Spigot, Fabric or Sponge ## Requirements > **Note:** If the plugin fails to load, please check that you are not running an [incompatible version combination](Unsupported-Versions) -* A Spigot (1.16.5+), Fabric (latest Minecraft version), or Sponge (Implementing API v8) _Minecraft: Java Edition_ server running on Java 16+ +* A Spigot (1.17.1+), Fabric (latest Minecraft version), or Sponge (Implementing API v10) _Minecraft: Java Edition_ server running on Java 17+ * (For proxy network support) A proxy server (Velocity, BungeeCord) and MySQL (v8.0+)/MariaDB database * (For optional [[Redis support]]) A Redis database (v5.0+) ## Download HuskHomes for your server Download the correct jar file for your server from the [latest release page](https://github.com/WiIIiam278/HuskHomes/releases/latest): -* the `HuskHomes-Plugin` jar for Spigot or Paper servers +* the `HuskHomes-Paper` jar for Spigot or Paper servers * the `HuskHomes-Fabric` jar for Fabric servers * or the `HuskHomes-Sponge` jar for Sponge servers diff --git a/docs/Unsupported-Versions.md b/docs/Unsupported-Versions.md index 7dad2dc0c..400c2303f 100644 --- a/docs/Unsupported-Versions.md +++ b/docs/Unsupported-Versions.md @@ -5,6 +5,7 @@ This plugin does not support the following software-Minecraft version combinatio |--------------------|-------------------------------------------|----------------------------------------| | 1.19.4 | Only: `Purpur, Pufferfish`† | Older Paper builds also not supported. | | 1.19.3 | Only: `Paper, Purpur, Pufferfish`† | Upgrade to 1.19.4 or use Spigot | +| 1.16.5 | _All_ | Use HuskHomes 4.5.5 | | below 1.16.5 | _All_ | Upgrade to 1.16.5 | †Further downstream forks of this server software are also affected. \ No newline at end of file diff --git a/fabric/src/main/java/net/william278/huskhomes/user/FabricUser.java b/fabric/src/main/java/net/william278/huskhomes/user/FabricUser.java index 935d112dc..8a696e6eb 100644 --- a/fabric/src/main/java/net/william278/huskhomes/user/FabricUser.java +++ b/fabric/src/main/java/net/william278/huskhomes/user/FabricUser.java @@ -45,7 +45,7 @@ public class FabricUser extends OnlineUser { private final ServerPlayerEntity player; private FabricUser(@NotNull ServerPlayerEntity player, @NotNull FabricHuskHomes plugin) { - super(player.getUuid(), player.getEntityName(), plugin); + super(player.getUuid(), player.getGameProfile().getName(), plugin); this.player = player; } diff --git a/gradle.properties b/gradle.properties index 4e0465206..fc556f3a7 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,27 +1,26 @@ -javaVersion=16 +javaVersion=17 org.gradle.jvmargs='-Dfile.encoding=UTF-8' org.gradle.daemon=true -plugin_version=4.5.5 +# Plugin metadata +plugin_version=4.6 plugin_archive=huskhomes plugin_description=The powerful and intuitive homes, warps, and teleports plugin/mod # General settings jedis_version=5.1.0 -commons_pool_version=2.12.0 -sqlite_driver_version=3.44.0.0 +mysql_driver_version=8.3.0 +mariadb_driver_version=3.3.2 +sqlite_driver_version=3.45.0.0 h2_driver_version=2.2.220 -mysql_driver_version=8.2.0 -mariadb_driver_version=3.3.0 +commons_pool_version=2.12.0 # Fabric settings -fabric_loom_version=1.3-SNAPSHOT - -fabric_minecraft_version=1.20.2 -fabric_loader_version=0.14.23 -fabric_yarn_mappings=1.20.2+build.4 -fabric_api_version=0.90.0+1.20.2 - +fabric_loom_version=1.5-SNAPSHOT +fabric_minecraft_version=1.20.4 +fabric_loader_version=0.15.6 +fabric_yarn_mappings=1.20.4+build.3 +fabric_api_version=0.95.4+1.20.4 fabric_permissions_api_version=0.2-SNAPSHOT -adventure_platform_fabric_version=5.10.0 +adventure_platform_fabric_version=5.11.0 diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index ccebba7710deaf9f98673a68957ea02138b60d0a..c1962a79e29d3e0ab67b14947c167a862655af9b 100644 GIT binary patch delta 8979 zcmY*fV{{$d(moANW81db*tXT!Nn`UgX2ZtD$%&n`v2C-lt;YD?@2-14?EPcUv!0n* z`^Ws4HP4i8L%;4p*JkD-J9ja2aKi!sX@~#-MY5?EPBK~fXAl)Ti}^QGH@6h+V+|}F zv=1RqQxhWW9!hTvYE!)+*m%jEL^9caK;am9X8QP~a9X0N6(=WSX8KF#WpU-6TjyR3 zpKhscivP97d$DGc{KI(f#g07u{Jr0wn#+qNr}yW}2N3{Kx0lCq%p4LBKil*QDTEyR zg{{&=GAy_O0VJ(8ZbtS4tPeeeILKK(M?HtQY!6K^wt zxsPH>E%g%V@=!B;kWF54$xjC&4hO!ZEG0QFMHLqe!tgH;%vO62BQj||nokbX&2kxF zzg#N!2M|NxFL#YdwOL8}>iDLr%2=!LZvk_&`AMrm7Zm%#_{Ot_qw=HkdVg{f9hYHF zlRF*9kxo~FPfyBD!^d6MbD?BRZj(4u9j!5}HFUt+$#Jd48Fd~ahe@)R9Z2M1t%LHa z_IP|tDb0CDl(fsEbvIYawJLJ7hXfpVw)D-)R-mHdyn5uZYefN0rZ-#KDzb`gsow;v zGX>k|g5?D%Vn_}IJIgf%nAz{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i*dy-PiwbD-+j`ezvd4C`%F1y^7t}2aww}ZlPk)t z=Y`tm#jNM$d`pG%F42Xmg_pZnEnvC%avz=xNs!=6b%%JSuc(WObezkCeZ#C|3PpXj zkR8hDPyTIUv~?<%*)6=8`WfPPyB9goi+p$1N2N<%!tS2wopT2x`2IZi?|_P{GA|I5 z?7DP*?Gi#2SJZ!x#W9Npm)T;=;~Swyeb*!P{I^s@o5m_3GS2Lg?VUeBdOeae7&s5$ zSL_VuTJih_fq7g8O8b0g+GbmE+xG}^Wx`g~{mWTyr@=h zKlAymoHeZa`DgR?Pj8Yc+I|MrSB>X*ts#wNFOJxs!3aGE)xeTHlF`fC5^g(DTacl$ zx!ezQJdwIyc$8RyNS~Wh{0pp>8NcW)*J=7AQYdT?(QhJuq4u`QniZ!%6l{KWp-0Xp z4ZC6(E(_&c$$U_cmGFslsyX6(62~m*z8Yx2p+F5xmD%6A7eOnx`1lJA-Mrc#&xZWJ zzXV{{OIgzYaq|D4k^j%z|8JB8GnRu3hw#8Z@({sSmsF(x>!w0Meg5y(zg!Z0S^0k# z5x^g1@L;toCK$NB|Fn adaptWorld(@Nullable ServerWorld world) { if (world == null) { return Optional.empty(); } - final String worldType = world.properties().worldType().asTemplate().key().asString(); + + // Get the world type from the world properties + final DefaultedRegistryType registry = WorldTypes.registry().type().asDefaultedType(world::engine); return Optional.of(World.from( - world.key().toString(), world.uniqueId(), - (worldType.equals(WorldTypeTemplate.theNether().key().toString()) ? World.Environment.NETHER - : worldType.equals(WorldTypeTemplate.theEnd().key().toString()) ? World.Environment.THE_END - : worldType.equals(WorldTypeTemplate.overworld().key().toString()) ? World.Environment.OVERWORLD - : World.Environment.CUSTOM) + world.key().toString(), + world.uniqueId(), + switch (world.properties().worldType().key(registry).asString()) { + case "minecraft:overworld" -> World.Environment.OVERWORLD; + case "minecraft:the_nether" -> World.Environment.NETHER; + case "minecraft:the_end" -> World.Environment.THE_END; + default -> World.Environment.CUSTOM; + } )); }