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 ccebba771..c1962a79e 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 37aef8d3f..509c4a29b 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 79a61d421..aeb74cbb4 100755 --- a/gradlew +++ b/gradlew @@ -85,9 +85,6 @@ done APP_BASE_NAME=${0##*/} APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' - # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -197,6 +194,10 @@ if "$cygwin" || "$msys" ; then done fi + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + # Collect all arguments for the java command; # * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of # shell script including quotes and variable substitutions, so put them in diff --git a/paper/build.gradle b/paper/build.gradle index 89cf4646b..5109541d4 100644 --- a/paper/build.gradle +++ b/paper/build.gradle @@ -1,5 +1,5 @@ plugins { - id 'xyz.jpenilla.run-paper' version '2.2.2' + id 'xyz.jpenilla.run-paper' version '2.2.3' } dependencies { @@ -41,6 +41,8 @@ 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() } tasks { diff --git a/plugin/build.gradle b/plugin/build.gradle deleted file mode 100644 index e5b85eb67..000000000 --- a/plugin/build.gradle +++ /dev/null @@ -1,4 +0,0 @@ -dependencies { - implementation project(path: ':bukkit', configuration: 'shadow') - runtimeOnly project(path: ':paper') -} \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index 12a720415..2120d2b28 100644 --- a/settings.gradle +++ b/settings.gradle @@ -12,7 +12,6 @@ include( // Paper/Spigot 'bukkit', 'paper', - 'plugin', // Fabric 'fabric', diff --git a/sponge/build.gradle b/sponge/build.gradle index 41bef1b22..e460ebbbb 100644 --- a/sponge/build.gradle +++ b/sponge/build.gradle @@ -17,7 +17,7 @@ dependencies { } sponge { - apiVersion("8.1.0") + apiVersion("10.0.0") loader { name(PluginLoaders.JAVA_PLAIN) version("1.0") diff --git a/sponge/src/main/java/net/william278/huskhomes/util/SpongeAdapter.java b/sponge/src/main/java/net/william278/huskhomes/util/SpongeAdapter.java index d1cea5786..592bc1e20 100644 --- a/sponge/src/main/java/net/william278/huskhomes/util/SpongeAdapter.java +++ b/sponge/src/main/java/net/william278/huskhomes/util/SpongeAdapter.java @@ -25,7 +25,9 @@ import org.jetbrains.annotations.Nullable; import org.spongepowered.api.ResourceKey; import org.spongepowered.api.Sponge; -import org.spongepowered.api.world.WorldTypeTemplate; +import org.spongepowered.api.registry.DefaultedRegistryType; +import org.spongepowered.api.world.WorldType; +import org.spongepowered.api.world.WorldTypes; import org.spongepowered.api.world.server.ServerLocation; import org.spongepowered.api.world.server.ServerWorld; import org.spongepowered.api.world.server.WorldManager; @@ -75,13 +77,18 @@ public static Optional 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; + } )); }