diff --git a/build.gradle b/build.gradle deleted file mode 100644 index c02a963..0000000 --- a/build.gradle +++ /dev/null @@ -1,34 +0,0 @@ -plugins { - id 'java' - id 'com.gradleup.shadow' version '9.3.1' -} - -java { - toolchain { - languageVersion = JavaLanguageVersion.of(25) - } -} - -repositories { - mavenCentral() - maven { - name = 'hytale' - url = 'https://maven.hytale.com/release' - } -} - -dependencies { - compileOnly 'com.hypixel.hytale:Server:+' -} - -tasks.named('jar') { - enabled = false -} - -tasks.named('build') { - dependsOn tasks.named('shadowJar') -} - -tasks.named('shadowJar') { - archiveClassifier.set('') -} diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 0000000..95521fb --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,74 @@ +plugins { + id("java-library") + id("com.gradleup.shadow") version "9.3.1" +} + +group = findProperty("pluginGroup") as String? ?: "com.mythlane" +version = findProperty("pluginVersion") as String? ?: "0.1.0" +description = findProperty("pluginDescription") as String? ?: "Hytale Gravity Flip" + +val hytaleServerVersion: String by project + +repositories { + mavenLocal() + mavenCentral() + maven { + name = "hytale" + url = uri("https://maven.hytale.com/release") + } +} + +dependencies { + compileOnly("com.hypixel.hytale:Server:$hytaleServerVersion") + + implementation("com.google.code.gson:gson:2.10.1") + implementation("org.jetbrains:annotations:24.1.0") + + testImplementation("org.junit.jupiter:junit-jupiter:5.10.0") + testRuntimeOnly("org.junit.platform:junit-platform-launcher") +} + +java { + toolchain { + languageVersion.set(JavaLanguageVersion.of(25)) + } +} + +tasks { + compileJava { + options.encoding = Charsets.UTF_8.name() + options.release = 25 + } + + processResources { + filteringCharset = Charsets.UTF_8.name() + val props = mapOf( + "group" to project.group, + "version" to project.version, + "description" to project.description, + "hytaleServerVersion" to hytaleServerVersion + ) + inputs.properties(props) + filesMatching("manifest.json") { + expand(props) + } + } + + shadowJar { + archiveBaseName.set("hytale-gravity-flip") + archiveClassifier.set("") + relocate("com.google.gson", "com.mythlane.gravityflip.libs.gson") + } + + jar { + enabled = false + } + + build { + dependsOn(shadowJar) + } + + test { + useJUnitPlatform() + } +} diff --git a/gradle.properties b/gradle.properties index d6528bd..c09d225 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,2 +1,6 @@ -group=com.mythlane -version=0.1.0 +pluginGroup=com.mythlane +pluginVersion=0.1.0 +pluginDescription=Hytale plugin - inverted gravity zones defined via an in-game wand +hytaleServerVersion=2026.03.26-89796e57b + +org.gradle.jvmargs=-Xmx1024m diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 1b33c55..d997cfc 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 ca025c8..c61a118 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.14-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.1-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index 0f14772..4bb327e 100644 --- a/gradlew +++ b/gradlew @@ -1,7 +1,7 @@ #!/bin/sh # -# Copyright © 2015-2021 the original authors. +# Copyright © 2015 the original authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -57,7 +57,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/b631911858264c0b6e4d6603d677ff5218766cee/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -114,7 +114,6 @@ case "$( uname )" in #( NONSTOP* ) nonstop=true ;; esac -CLASSPATH="\\\"\\\"" # Determine the Java command to use to start the JVM. @@ -172,7 +171,6 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) JAVACMD=$( cygpath --unix "$JAVACMD" ) @@ -212,7 +210,6 @@ DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ "$@" diff --git a/gradlew.bat b/gradlew.bat index 8de1053..bd8a8c0 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -70,11 +70,10 @@ goto fail :execute @rem Setup the command line -set CLASSPATH= @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* :end @rem End local scope for the variables with windows NT shell diff --git a/settings.gradle b/settings.gradle deleted file mode 100644 index 79a5e92..0000000 --- a/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -rootProject.name = 'hytale-gravity-flip' diff --git a/settings.gradle.kts b/settings.gradle.kts new file mode 100644 index 0000000..01b0809 --- /dev/null +++ b/settings.gradle.kts @@ -0,0 +1 @@ +rootProject.name = "hytale-gravity-flip" diff --git a/src/main/resources/manifest.json b/src/main/resources/manifest.json index c51c68d..155dd22 100644 --- a/src/main/resources/manifest.json +++ b/src/main/resources/manifest.json @@ -1,11 +1,20 @@ { - "group": "com.mythlane", - "name": "hytale-gravity-flip", - "version": "0.1.0", - "serverVersion": "2026.03.26-89796e57b", - "description": "Inverted gravity zones defined via an in-game wand.", - "authors": [ - { "name": "Mythlane" } + "Group": "Mythlane", + "Name": "GravityFlip", + "Version": "${version}", + "Description": "${description}", + "Authors": [ + { + "Name": "Mythlane Team", + "Email": "contact@mythlane.com", + "Url": "https://mythlane.com" + } ], - "main": "com.mythlane.gravityflip.GravityFlipPlugin" + "Website": "https://mythlane.com", + "Main": "com.mythlane.gravityflip.GravityFlipPlugin", + "ServerVersion": "${hytaleServerVersion}", + "Dependencies": {}, + "OptionalDependencies": {}, + "DisabledByDefault": false, + "IncludesAssetPack": false }