diff --git a/build.gradle b/build.gradle index f15ff7c..c198f5c 100644 --- a/build.gradle +++ b/build.gradle @@ -1,8 +1,8 @@ plugins { - id 'fabric-loom' version '1.10-SNAPSHOT' + id 'fabric-loom' version "${loom_version}" id 'maven-publish' - id "org.jetbrains.kotlin.jvm" version "2.1.20" - id 'com.github.johnrengelman.shadow' version '8.1.1' + id "org.jetbrains.kotlin.jvm" version "2.2.21" + id("com.gradleup.shadow") version "9.3.0" } version = project.mod_version @@ -12,6 +12,7 @@ base { archivesName = project.archives_base_name } + repositories { // Add repositories to retrieve artifacts from in here. // You should only use this when depending on other mods because @@ -19,13 +20,13 @@ repositories { // See https://docs.gradle.org/current/userguide/declaring_repositories.html // for more information about repositories. maven { - name 'Xander Maven' - url 'https://maven.isxander.dev/releases' + name = 'Xander Maven' + url = 'https://maven.isxander.dev/releases' } maven { - name 'TerraformersMC' - url 'https://maven.terraformersmc.com/releases' + name = 'TerraformersMC' + url = 'https://maven.terraformersmc.com/releases' } } @@ -33,20 +34,16 @@ dependencies { // To change the versions see the gradle.properties file minecraft "com.mojang:minecraft:${project.minecraft_version}" mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2" - modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" shadow(implementation("com.squareup.okhttp3:okhttp:4.12.0")) - // Fabric API. This is technically optional, but you probably want it anyway. + // Fabric API. + modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" modImplementation "net.fabricmc:fabric-language-kotlin:${project.fabric_kotlin_version}" - // Uncomment the following line to enable the deprecated Fabric API modules. - // These are included in the Fabric API production distribution and allow you to update your mod to the latest modules at a later more convenient time. - - // modImplementation "net.fabricmc.fabric-api:fabric-api-deprecated:${project.fabric_version}" - modImplementation 'dev.isxander:yet-another-config-lib:3.6.6+1.21.5-fabric' - modImplementation 'com.terraformersmc:modmenu:14.0.0-rc.2' + modImplementation "dev.isxander:yet-another-config-lib:${project.yet_another_config_lib_version}" + modImplementation "com.terraformersmc:modmenu:${project.mod_menu_version}" } processResources { diff --git a/gradle.properties b/gradle.properties index 4f8c2d6..b841e77 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,16 +4,20 @@ org.gradle.parallel=true # Fabric Properties # check these on https://fabricmc.net/develop +minecraft_version=1.21.10 +yarn_mappings=1.21.10+build.3 +loader_version=0.18.2 +fabric_kotlin_version=1.13.7+kotlin.2.2.21 +loom_version=1.14-SNAPSHOT -minecraft_version=1.21.5 -yarn_mappings=1.21.5+build.1 -loader_version=0.16.13 -fabric_kotlin_version=1.13.2+kotlin.2.1.20 +# Dependencies +yet_another_config_lib_version=3.6.1+1.21-fabric +mod_menu_version=16.0.0-rc.1 # Mod Properties -mod_version=1.1.0+mc1.21.5 +mod_version=1.2.0+mc1.21.10 maven_group=openshock.integrations.minecraft archives_base_name=shockcraft # Dependencies -fabric_version=0.120.0+1.21.5 \ No newline at end of file +fabric_version=0.138.3+1.21.10 \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index d64cd49..f8e1ee3 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 cea7a79..23449a2 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.12-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew old mode 100644 new mode 100755 index 1aa94a4..adff685 --- 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. @@ -15,6 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## # @@ -55,7 +57,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/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/. @@ -84,7 +86,7 @@ done # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) -APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -112,7 +114,6 @@ case "$( uname )" in #( NONSTOP* ) nonstop=true ;; esac -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. @@ -170,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" ) @@ -203,15 +203,14 @@ fi DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Collect all arguments for the java command: -# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, # and any embedded shellness will be escaped. # * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be # treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ + -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ "$@" # Stop when "xargs" is not available. diff --git a/gradlew.bat b/gradlew.bat index 25da30d..c4bdd3a 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -13,6 +13,8 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem @if "%DEBUG%"=="" @echo off @rem ########################################################################## @@ -68,11 +70,10 @@ goto fail :execute @rem Setup the command line -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +"%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/src/main/kotlin/openshock/integrations/minecraft/api/OpenShockApi.kt b/src/main/kotlin/openshock/integrations/minecraft/api/OpenShockApi.kt index 67570b9..31d1173 100644 --- a/src/main/kotlin/openshock/integrations/minecraft/api/OpenShockApi.kt +++ b/src/main/kotlin/openshock/integrations/minecraft/api/OpenShockApi.kt @@ -13,16 +13,20 @@ import openshock.integrations.minecraft.ShockCraft import openshock.integrations.minecraft.config.ShockCraftConfig import openshock.integrations.minecraft.utils.await import org.w3c.dom.Text +import org.slf4j.LoggerFactory + object OpenShockApi { + private val logger = LoggerFactory.getLogger("OpenShockApi") + private const val SUFFIX: String = " (Integrations.Minecraft)" private val JSON: MediaType = "application/json".toMediaType() private val client: OkHttpClient = OkHttpClient() suspend fun control(type: ControlType, intensity: Byte, duration: UShort, name: String) { - ShockCraft.logger.info("Sending $type with $intensity intensity for $duration ms [$name]") + logger.info("Sending $type with $intensity intensity for $duration ms [$name]") val shocks = ArrayList() ShockCraftConfig.HANDLER.instance().shockers.forEach { @@ -45,7 +49,7 @@ object OpenShockApi { val response = client.newCall(request).await() - ShockCraft.logger.debug(response.body!!.string()) + logger.debug(response.body!!.string()) val inSeconds = (duration.toFloat() / 1000f) diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 5bf519e..f3965ef 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -17,7 +17,7 @@ "icon": "assets/shockcraft/icon.png", "environment": "client", "entrypoints": { - "main": [ + "client": [ { "value": "openshock.integrations.minecraft.ShockCraft", "adapter": "kotlin" @@ -31,11 +31,11 @@ "shockcraft.mixins.json" ], "depends": { - "fabricloader": ">=0.15.11", - "minecraft": "~1.21", + "fabricloader": ">=0.18.0", + "minecraft": "~1.21.10", "java": ">=17", "fabric-api": "*", - "fabric-language-kotlin": ">=1.11.0", + "fabric-language-kotlin": ">=1.13.7+kotlin.2.2.21", "yet_another_config_lib_v3": "*", "modmenu": "*" },