Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 12 additions & 15 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -12,41 +12,38 @@ 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
// Loom adds the essential maven repositories to download Minecraft and libraries from automatically.
// 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'
}
}

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 {
Expand Down
16 changes: 10 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
fabric_version=0.138.3+1.21.10
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
Expand Down
15 changes: 7 additions & 8 deletions gradlew
100644 → 100755
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#

##############################################################################
#
Expand Down Expand Up @@ -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/.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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" )

Expand Down Expand Up @@ -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.
Expand Down
5 changes: 3 additions & 2 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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 ##########################################################################
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<ControlItem>()

ShockCraftConfig.HANDLER.instance().shockers.forEach {
Expand All @@ -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)

Expand Down
8 changes: 4 additions & 4 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"icon": "assets/shockcraft/icon.png",
"environment": "client",
"entrypoints": {
"main": [
"client": [
{
"value": "openshock.integrations.minecraft.ShockCraft",
"adapter": "kotlin"
Expand All @@ -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": "*"
},
Expand Down