diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..b2b682d --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,58 @@ +name: Build + +on: + push: + branches: [master] + pull_request: + branches: [master] + workflow_dispatch: + +permissions: + contents: read + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up JDK 25 + uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: "25" + + - name: Set up Gradle + uses: gradle/actions/setup-gradle@v4 + + - name: Cache Fabric Loom project cache + uses: actions/cache@v4 + with: + path: .gradle/loom-cache + key: loom-cache-${{ runner.os }}-${{ hashFiles('gradle.properties') }} + restore-keys: | + loom-cache-${{ runner.os }}- + + - name: Make ./gradlew executable + run: chmod +x ./gradlew + + - name: Check license headers + run: ./gradlew :common:checkLicenses :backend:checkLicenses :26.2-fabric:checkLicenses :26.2-neoforge:checkLicenses + + - name: Build + run: ./gradlew :common:build :backend:build :26.2-fabric:build :26.2-neoforge:build + + - name: Upload Fabric jar + uses: actions/upload-artifact@v4 + with: + name: strand-fabric-26.2 + path: versions/26.2-fabric/build/libs/*.jar + if-no-files-found: error + + - name: Upload NeoForge jar + uses: actions/upload-artifact@v4 + with: + name: strand-neoforge-26.2 + path: versions/26.2-neoforge/build/libs/*.jar + if-no-files-found: error diff --git a/build.gradle.kts b/build.fabric.gradle.kts similarity index 73% rename from build.gradle.kts rename to build.fabric.gradle.kts index ae3b769..4e0690b 100644 --- a/build.gradle.kts +++ b/build.fabric.gradle.kts @@ -2,35 +2,39 @@ import org.jetbrains.kotlin.gradle.dsl.JvmTarget import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { - kotlin("jvm") version "2.4.10" - kotlin("plugin.serialization") version "2.4.10" - id("net.fabricmc.fabric-loom") version "1.17.16" - id("maven-publish") - id("dev.yumi.gradle.licenser") version "4.0.+" + kotlin("jvm") + kotlin("plugin.serialization") + id("net.fabricmc.fabric-loom") + id("dev.yumi.gradle.licenser") + `maven-publish` } version = project.property("mod_version") as String group = project.property("maven_group") as String +repositories { + mavenLocal() + maven("https://maven.cloverclient.com/releases") + maven("https://pkgs.dev.azure.com/djtheredstoner/DevAuth/_packaging/public/maven/v1") + mavenCentral() +} + base { archivesName.set(project.property("archives_base_name") as String) } +sourceSets.main { + kotlin.srcDir(rootProject.file("src/fabric/kotlin")) +} + val targetJavaVersion = 25 java { toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion) withSourcesJar() } -repositories { - mavenLocal() - maven("https://maven.cloverclient.com/releases") - maven("https://pkgs.dev.azure.com/djtheredstoner/DevAuth/_packaging/public/maven/v1") - mavenCentral() -} - dependencies { - minecraft("com.mojang:minecraft:${project.property("minecraft_version")}") + minecraft("com.mojang:minecraft:${sc.current.version}") implementation("net.fabricmc:fabric-loader:${project.property("loader_version")}") implementation("net.fabricmc:fabric-language-kotlin:${project.property("kotlin_loader_version")}") implementation("net.fabricmc.fabric-api:fabric-api:${project.property("fabric_version")}") @@ -38,18 +42,20 @@ dependencies { runtimeOnly("me.djtheredstoner:DevAuth-fabric:1.2.2") implementation(include("gg.sona:eos:1.1.0")!!) + + implementation(project(":common")) } tasks.processResources { inputs.property("version", project.version) - inputs.property("minecraft_version", project.property("minecraft_version")) + inputs.property("minecraft_version", sc.current.version) inputs.property("loader_version", project.property("loader_version")) filteringCharset = "UTF-8" filesMatching("fabric.mod.json") { expand( "version" to project.version, - "minecraft_version" to project.property("minecraft_version") as String, + "minecraft_version" to sc.current.version, "loader_version" to project.property("loader_version") as String, "kotlin_loader_version" to project.property("kotlin_loader_version") as String ) @@ -66,25 +72,34 @@ tasks.withType().configureEach { } tasks.jar { - from("LICENSE.md") { + from(rootProject.file("LICENSE.md")) { rename { "${it}_${project.base.archivesName.get()}" } } - from("NOTICE.md") { + from(rootProject.file("NOTICE.md")) { rename { "${it}_${project.base.archivesName.get()}" } } - from("PRIVACY_POLICY.md") { + from(rootProject.file("PRIVACY_POLICY.md")) { rename { "${it}_${project.base.archivesName.get()}" } } } license { - rule(file("codeformat/HEADER")) + rule(rootProject.file("codeformat/HEADER")) include("**/*.java") include("**/*.kt") exclude("**/*.properties") } +loom { + runConfigs.all { + preferGradleTask = true + generateRunConfig = true + runDirectory = rootProject.file("run") + jvmArguments.add("-Ddevauth.enabled=true") + } +} + publishing { publications { create("mavenJava") { diff --git a/build.neoforge.gradle.kts b/build.neoforge.gradle.kts new file mode 100644 index 0000000..640ed7a --- /dev/null +++ b/build.neoforge.gradle.kts @@ -0,0 +1,117 @@ +import org.jetbrains.kotlin.gradle.dsl.JvmTarget +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile + +plugins { + kotlin("jvm") + kotlin("plugin.serialization") + id("net.neoforged.moddev") + id("dev.yumi.gradle.licenser") + `maven-publish` +} + +version = project.property("mod_version") as String +group = project.property("maven_group") as String + +repositories { + mavenLocal() + maven("https://maven.cloverclient.com/releases") + maven("https://pkgs.dev.azure.com/djtheredstoner/DevAuth/_packaging/public/maven/v1") + mavenCentral() +} + +base { + archivesName.set(project.property("archives_base_name") as String) +} + +sourceSets.main { + kotlin.srcDir(rootProject.file("src/neoforge/kotlin")) + resources { + srcDir("src/main/resources-neoforge") + } +} + +val targetJavaVersion = 25 +java { + toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion) + withSourcesJar() +} + +neoForge { + version = project.property("neo_version") as String + + runs { + create("client") { + gameDirectory = file("../../run/") + client() + jvmArgument("-Ddevauth.enabled=true") + } + } + + mods { + create("strand") { + sourceSet(sourceSets.main.get()) + } + } +} + +dependencies { + implementation("gg.sona:eos:1.1.0") + jarJar("gg.sona:eos:1.1.0") + + runtimeOnly("me.djtheredstoner:DevAuth-neoforge:1.2.2") + + implementation(project(":common")) +} + +tasks.processResources { + inputs.property("version", project.version) + inputs.property("minecraft_version", sc.current.version) + inputs.property("neo_version", project.property("neo_version")) + filteringCharset = "UTF-8" + + filesMatching("**/neoforge.mods.toml") { + expand( + "version" to project.version, + "minecraft_version" to sc.current.version, + "neo_version" to project.property("neo_version") as String + ) + } +} + +tasks.withType().configureEach { + options.encoding = "UTF-8" + options.release.set(targetJavaVersion) +} + +tasks.withType().configureEach { + compilerOptions.jvmTarget.set(JvmTarget.fromTarget(targetJavaVersion.toString())) +} + +tasks.jar { + from(rootProject.file("LICENSE.md")) { + rename { "${it}_${project.base.archivesName.get()}" } + } + from(rootProject.file("NOTICE.md")) { + rename { "${it}_${project.base.archivesName.get()}" } + } + from(rootProject.file("PRIVACY_POLICY.md")) { + rename { "${it}_${project.base.archivesName.get()}" } + } +} + +license { + rule(rootProject.file("codeformat/HEADER")) + + include("**/*.java") + include("**/*.kt") + exclude("**/*.properties") +} + +publishing { + publications { + create("mavenJava") { + artifactId = project.property("archives_base_name") as String + from(components["java"]) + } + } +} diff --git a/common/build.gradle.kts b/common/build.gradle.kts new file mode 100644 index 0000000..3303569 --- /dev/null +++ b/common/build.gradle.kts @@ -0,0 +1,39 @@ +import org.jetbrains.kotlin.gradle.dsl.JvmTarget +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile + +plugins { + kotlin("jvm") + kotlin("plugin.serialization") + id("dev.yumi.gradle.licenser") +} + +version = project.property("mod_version") as String +group = project.property("maven_group") as String + +val targetJavaVersion = 25 +java { + toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion) + withSourcesJar() +} + +dependencies { + implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.11.0") + implementation("gg.sona:eos:1.1.0") + + compileOnly("org.slf4j:slf4j-api:2.0.18") +} + +tasks.withType().configureEach { + options.encoding = "UTF-8" + options.release.set(targetJavaVersion) +} + +tasks.withType().configureEach { + compilerOptions.jvmTarget.set(JvmTarget.fromTarget(targetJavaVersion.toString())) +} + +license { + rule(file("../codeformat/HEADER")) + + include("**/*.kt") +} diff --git a/src/main/kotlin/re/lilith/strand/StrandConfig.kt b/common/src/main/kotlin/re/lilith/strand/StrandConfig.kt similarity index 91% rename from src/main/kotlin/re/lilith/strand/StrandConfig.kt rename to common/src/main/kotlin/re/lilith/strand/StrandConfig.kt index 6ee5854..7a3a1e3 100644 --- a/src/main/kotlin/re/lilith/strand/StrandConfig.kt +++ b/common/src/main/kotlin/re/lilith/strand/StrandConfig.kt @@ -20,8 +20,8 @@ package re.lilith.strand import kotlinx.serialization.Serializable import kotlinx.serialization.json.Json -import net.fabricmc.loader.api.FabricLoader import java.nio.file.Files +import java.nio.file.Path import kotlin.io.path.exists @Serializable @@ -34,8 +34,8 @@ data class StrandConfig( companion object { private val json = Json { prettyPrint = true; ignoreUnknownKeys = true; encodeDefaults = true } - fun load(): StrandConfig { - val path = FabricLoader.getInstance().configDir.resolve("strand.json") + fun load(configDir: Path): StrandConfig { + val path = configDir.resolve("strand.json") if (!path.exists()) { val default = StrandConfig() runCatching { Files.writeString(path, json.encodeToString(default)) } diff --git a/src/main/kotlin/re/lilith/strand/StrandState.kt b/common/src/main/kotlin/re/lilith/strand/StrandState.kt similarity index 100% rename from src/main/kotlin/re/lilith/strand/StrandState.kt rename to common/src/main/kotlin/re/lilith/strand/StrandState.kt diff --git a/src/main/kotlin/re/lilith/strand/backend/BackendClient.kt b/common/src/main/kotlin/re/lilith/strand/backend/BackendClient.kt similarity index 100% rename from src/main/kotlin/re/lilith/strand/backend/BackendClient.kt rename to common/src/main/kotlin/re/lilith/strand/backend/BackendClient.kt diff --git a/src/main/kotlin/re/lilith/strand/backend/BackendException.kt b/common/src/main/kotlin/re/lilith/strand/backend/BackendException.kt similarity index 100% rename from src/main/kotlin/re/lilith/strand/backend/BackendException.kt rename to common/src/main/kotlin/re/lilith/strand/backend/BackendException.kt diff --git a/src/main/kotlin/re/lilith/strand/backend/Models.kt b/common/src/main/kotlin/re/lilith/strand/backend/Models.kt similarity index 100% rename from src/main/kotlin/re/lilith/strand/backend/Models.kt rename to common/src/main/kotlin/re/lilith/strand/backend/Models.kt diff --git a/src/main/kotlin/re/lilith/strand/eos/EosConnectAuth.kt b/common/src/main/kotlin/re/lilith/strand/eos/EosConnectAuth.kt similarity index 100% rename from src/main/kotlin/re/lilith/strand/eos/EosConnectAuth.kt rename to common/src/main/kotlin/re/lilith/strand/eos/EosConnectAuth.kt diff --git a/src/main/kotlin/re/lilith/strand/eos/EosConstants.kt b/common/src/main/kotlin/re/lilith/strand/eos/EosConstants.kt similarity index 100% rename from src/main/kotlin/re/lilith/strand/eos/EosConstants.kt rename to common/src/main/kotlin/re/lilith/strand/eos/EosConstants.kt diff --git a/src/main/kotlin/re/lilith/strand/eos/EosLoginSession.kt b/common/src/main/kotlin/re/lilith/strand/eos/EosLoginSession.kt similarity index 100% rename from src/main/kotlin/re/lilith/strand/eos/EosLoginSession.kt rename to common/src/main/kotlin/re/lilith/strand/eos/EosLoginSession.kt diff --git a/src/main/kotlin/re/lilith/strand/eos/EosManager.kt b/common/src/main/kotlin/re/lilith/strand/eos/EosManager.kt similarity index 100% rename from src/main/kotlin/re/lilith/strand/eos/EosManager.kt rename to common/src/main/kotlin/re/lilith/strand/eos/EosManager.kt diff --git a/src/main/kotlin/re/lilith/strand/invite/PendingInvite.kt b/common/src/main/kotlin/re/lilith/strand/invite/PendingInvite.kt similarity index 100% rename from src/main/kotlin/re/lilith/strand/invite/PendingInvite.kt rename to common/src/main/kotlin/re/lilith/strand/invite/PendingInvite.kt diff --git a/src/main/kotlin/re/lilith/strand/net/HostBridge.kt b/common/src/main/kotlin/re/lilith/strand/net/HostBridge.kt similarity index 100% rename from src/main/kotlin/re/lilith/strand/net/HostBridge.kt rename to common/src/main/kotlin/re/lilith/strand/net/HostBridge.kt diff --git a/src/main/kotlin/re/lilith/strand/net/JoinBridge.kt b/common/src/main/kotlin/re/lilith/strand/net/JoinBridge.kt similarity index 100% rename from src/main/kotlin/re/lilith/strand/net/JoinBridge.kt rename to common/src/main/kotlin/re/lilith/strand/net/JoinBridge.kt diff --git a/src/main/kotlin/re/lilith/strand/net/P2PHub.kt b/common/src/main/kotlin/re/lilith/strand/net/P2PHub.kt similarity index 100% rename from src/main/kotlin/re/lilith/strand/net/P2PHub.kt rename to common/src/main/kotlin/re/lilith/strand/net/P2PHub.kt diff --git a/src/main/kotlin/re/lilith/strand/net/StreamHandler.kt b/common/src/main/kotlin/re/lilith/strand/net/StreamHandler.kt similarity index 100% rename from src/main/kotlin/re/lilith/strand/net/StreamHandler.kt rename to common/src/main/kotlin/re/lilith/strand/net/StreamHandler.kt diff --git a/src/main/kotlin/re/lilith/strand/net/TcpP2PStream.kt b/common/src/main/kotlin/re/lilith/strand/net/TcpP2PStream.kt similarity index 100% rename from src/main/kotlin/re/lilith/strand/net/TcpP2PStream.kt rename to common/src/main/kotlin/re/lilith/strand/net/TcpP2PStream.kt diff --git a/src/main/kotlin/re/lilith/strand/session/ClientHooks.kt b/common/src/main/kotlin/re/lilith/strand/session/ClientHooks.kt similarity index 100% rename from src/main/kotlin/re/lilith/strand/session/ClientHooks.kt rename to common/src/main/kotlin/re/lilith/strand/session/ClientHooks.kt diff --git a/src/main/kotlin/re/lilith/strand/session/ConnState.kt b/common/src/main/kotlin/re/lilith/strand/session/ConnState.kt similarity index 100% rename from src/main/kotlin/re/lilith/strand/session/ConnState.kt rename to common/src/main/kotlin/re/lilith/strand/session/ConnState.kt diff --git a/src/main/kotlin/re/lilith/strand/session/Profile.kt b/common/src/main/kotlin/re/lilith/strand/session/Profile.kt similarity index 100% rename from src/main/kotlin/re/lilith/strand/session/Profile.kt rename to common/src/main/kotlin/re/lilith/strand/session/Profile.kt diff --git a/src/main/kotlin/re/lilith/strand/session/SessionController.kt b/common/src/main/kotlin/re/lilith/strand/session/SessionController.kt similarity index 100% rename from src/main/kotlin/re/lilith/strand/session/SessionController.kt rename to common/src/main/kotlin/re/lilith/strand/session/SessionController.kt diff --git a/gradle.properties b/gradle.properties index d14dd90..273982f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,7 +3,6 @@ org.gradle.jvmargs=-Xmx2G org.gradle.parallel=true # Fabric Properties # check these on https://modmuss50.me/fabric.html -minecraft_version=26.2 yarn_mappings=1.21.11+build.6 loader_version=0.19.3 kotlin_loader_version=1.13.13+kotlin.2.4.10 @@ -14,3 +13,6 @@ archives_base_name=strand # Dependencies # check this on https://modmuss50.me/fabric.html fabric_version=0.155.2+26.2 +# check latest at https://maven.neoforged.net/releases/net/neoforged/neoforge/ -- this is a beta, +# bump it when a stable 26.2 NeoForge build lands +neo_version=26.2.0.8-beta diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..b1b8ef5 Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 537bbd3..a9db115 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1 +1,9 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists distributionUrl=https\://services.gradle.org/distributions/gradle-9.6.1-bin.zip +networkTimeout=10000 +retries=0 +retryBackOffMs=500 +validateDistributionUrl=true +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew new file mode 100644 index 0000000..249efbb --- /dev/null +++ b/gradlew @@ -0,0 +1,248 @@ +#!/bin/sh + +# +# 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. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 +# + +############################################################################## +# +# gradlew start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh gradlew +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/3d91ce3b8caaf77ad09f381f43615b715b53f72c/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/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +# This is normally unused +# 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 -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 + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + 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 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" \ + -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ + "$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 0000000..a51ec4f --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,82 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@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 ########################################################################## +@rem +@rem gradlew startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables, and ensure extensions are enabled +setlocal EnableExtensions + +set DIRNAME=%~dp0 +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if %ERRORLEVEL% equ 0 goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +"%COMSPEC%" /c exit 1 + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +"%COMSPEC%" /c exit 1 + +:execute +@rem Setup the command line + + + +@rem Execute gradlew +@rem endlocal doesn't take effect until after the line is parsed and variables are expanded +@rem which allows us to clear the local environment before executing the java command +endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* & call :exitWithErrorLevel + +:exitWithErrorLevel +@rem Use "%COMSPEC%" /c exit to allow operators to work properly in scripts +"%COMSPEC%" /c exit %ERRORLEVEL% diff --git a/settings.gradle.kts b/settings.gradle.kts index 3210104..42ed80b 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -3,11 +3,53 @@ pluginManagement { maven("https://maven.fabricmc.net/") { name = "Fabric" } + maven("https://maven.neoforged.net/releases/") { + name = "NeoForged" + } + maven("https://maven.kikugie.dev/releases") { + name = "KikuGie Releases" + } + maven("https://maven.kikugie.dev/snapshots") { + name = "KikuGie Snapshots" + } mavenCentral() gradlePluginPortal() } + + plugins { + kotlin("jvm") version "2.4.10" + kotlin("plugin.serialization") version "2.4.10" + id("net.fabricmc.fabric-loom") version "1.17.16" + id("net.neoforged.moddev") version "2.0.142" + id("dev.yumi.gradle.licenser") version "4.0.+" + } +} + +plugins { + id("dev.kikugie.stonecutter") version "0.9.6" +} + +stonecutter { + create(rootProject) { + fun match(version: String, vararg loaders: String) = + loaders.forEach { version("$version-$it", version).buildscript = "build.$it.gradle.kts" } + + match("26.2", "fabric", "neoforge") + + vcsVersion = "26.2-fabric" + } +} + +dependencyResolutionManagement { + repositories { + mavenLocal() + maven("https://maven.cloverclient.com/releases") + maven("https://pkgs.dev.azure.com/djtheredstoner/DevAuth/_packaging/public/maven/v1") + mavenCentral() + } } rootProject.name = "strand" include(":backend") +include(":common") diff --git a/src/main/kotlin/re/lilith/strand/client/StrandClient.kt b/src/fabric/kotlin/re/lilith/strand/platform/fabric/StrandClient.kt similarity index 91% rename from src/main/kotlin/re/lilith/strand/client/StrandClient.kt rename to src/fabric/kotlin/re/lilith/strand/platform/fabric/StrandClient.kt index 0ee50d4..dfb7cbb 100644 --- a/src/main/kotlin/re/lilith/strand/client/StrandClient.kt +++ b/src/fabric/kotlin/re/lilith/strand/platform/fabric/StrandClient.kt @@ -16,17 +16,19 @@ * along with this program. If not, see . */ -package re.lilith.strand.client +package re.lilith.strand.platform.fabric import re.lilith.strand.StrandConfig import re.lilith.strand.StrandState import re.lilith.strand.backend.BackendClient +import re.lilith.strand.client.StrandClientHooks import re.lilith.strand.eos.EosManager import re.lilith.strand.session.SessionController import gg.sona.eos.Eos import gg.sona.eos.EosNatives import net.fabricmc.api.ClientModInitializer import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientLifecycleEvents +import net.fabricmc.loader.api.FabricLoader import org.slf4j.LoggerFactory class StrandClient : ClientModInitializer { @@ -38,7 +40,7 @@ class StrandClient : ClientModInitializer { logger.info("Setting up EOS SDK...") logger.info("SDK version: ${Eos.version}") - val config = StrandConfig.load() + val config = StrandConfig.load(FabricLoader.getInstance().configDir) StrandState.config = config val backend = BackendClient("https://strand.lilith.re", config.oidcClientId, config.oidcRedirectUri) diff --git a/src/main/kotlin/re/lilith/strand/client/StrandCommands.kt b/src/fabric/kotlin/re/lilith/strand/platform/fabric/StrandCommands.kt similarity index 91% rename from src/main/kotlin/re/lilith/strand/client/StrandCommands.kt rename to src/fabric/kotlin/re/lilith/strand/platform/fabric/StrandCommands.kt index 02c14c2..ea79424 100644 --- a/src/main/kotlin/re/lilith/strand/client/StrandCommands.kt +++ b/src/fabric/kotlin/re/lilith/strand/platform/fabric/StrandCommands.kt @@ -16,26 +16,19 @@ * along with this program. If not, see . */ -package re.lilith.strand.client +package re.lilith.strand.platform.fabric import com.mojang.brigadier.arguments.StringArgumentType +import re.lilith.strand.client.StrandChat.PREFIX import re.lilith.strand.client.gui.StrandHubScreen import re.lilith.strand.session.SessionController import net.fabricmc.fabric.api.client.command.v2.ClientCommandRegistrationCallback import net.fabricmc.fabric.api.client.command.v2.ClientCommands import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource -import net.minecraft.ChatFormatting import net.minecraft.client.Minecraft import net.minecraft.network.chat.Component -import net.minecraft.network.chat.TextColor object StrandCommands { - val PREFIX = Component.literal("") - .append(Component.literal("[").withStyle(ChatFormatting.GRAY)) - .append(Component.literal("Strand").withStyle(ChatFormatting.AQUA)) - .append(Component.literal("]").withStyle(ChatFormatting.GRAY)) - .withStyle(ChatFormatting.WHITE) - fun register(controller: SessionController) { ClientCommandRegistrationCallback.EVENT.register { dispatcher, _ -> dispatcher.register( diff --git a/src/main/kotlin/re/lilith/strand/client/StrandScreenButtons.kt b/src/fabric/kotlin/re/lilith/strand/platform/fabric/StrandScreenButtons.kt similarity index 97% rename from src/main/kotlin/re/lilith/strand/client/StrandScreenButtons.kt rename to src/fabric/kotlin/re/lilith/strand/platform/fabric/StrandScreenButtons.kt index 3d4812c..19c0a42 100644 --- a/src/main/kotlin/re/lilith/strand/client/StrandScreenButtons.kt +++ b/src/fabric/kotlin/re/lilith/strand/platform/fabric/StrandScreenButtons.kt @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -package re.lilith.strand.client +package re.lilith.strand.platform.fabric import re.lilith.strand.client.gui.StrandHubScreen import net.fabricmc.fabric.api.client.screen.v1.ScreenEvents diff --git a/src/main/kotlin/re/lilith/strand/client/StrandChat.kt b/src/main/kotlin/re/lilith/strand/client/StrandChat.kt new file mode 100644 index 0000000..7d51b81 --- /dev/null +++ b/src/main/kotlin/re/lilith/strand/client/StrandChat.kt @@ -0,0 +1,30 @@ +/* + * Strand - Open your Minecraft world to anyone, anywhere. + * Copyright (C) 2026 Lilith Technologies LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +package re.lilith.strand.client + +import net.minecraft.ChatFormatting +import net.minecraft.network.chat.Component + +object StrandChat { + val PREFIX = Component.literal("") + .append(Component.literal("[").withStyle(ChatFormatting.GRAY)) + .append(Component.literal("Strand").withStyle(ChatFormatting.AQUA)) + .append(Component.literal("]").withStyle(ChatFormatting.GRAY)) + .withStyle(ChatFormatting.WHITE) +} diff --git a/src/main/kotlin/re/lilith/strand/client/StrandClientHooks.kt b/src/main/kotlin/re/lilith/strand/client/StrandClientHooks.kt index c69b457..5c4443f 100644 --- a/src/main/kotlin/re/lilith/strand/client/StrandClientHooks.kt +++ b/src/main/kotlin/re/lilith/strand/client/StrandClientHooks.kt @@ -19,7 +19,7 @@ package re.lilith.strand.client import com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService -import re.lilith.strand.client.StrandCommands.PREFIX +import re.lilith.strand.client.StrandChat.PREFIX import re.lilith.strand.client.gui.StrandMultiplayerOptionsScreen import re.lilith.strand.session.ClientHooks import re.lilith.strand.session.Profile diff --git a/src/main/resources-neoforge/META-INF/neoforge.mods.toml b/src/main/resources-neoforge/META-INF/neoforge.mods.toml new file mode 100644 index 0000000..5352875 --- /dev/null +++ b/src/main/resources-neoforge/META-INF/neoforge.mods.toml @@ -0,0 +1,26 @@ +license="AGPL-3.0" + +[[mods]] +modId="strand" +version="${version}" +displayName="Strand" +description=''' +Open your Minecraft world to anyone, anywhere. +''' + +[[mixins]] +config="strand.mixins.json" + +[[dependencies.strand]] + modId="neoforge" + type="required" + versionRange="[${neo_version},)" + ordering="NONE" + side="CLIENT" + +[[dependencies.strand]] + modId="minecraft" + type="required" + versionRange="[${minecraft_version},)" + ordering="NONE" + side="CLIENT" diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 348f68c..69f2166 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -33,7 +33,7 @@ ], "entrypoints": { "client": [ - "re.lilith.strand.client.StrandClient" + "re.lilith.strand.platform.fabric.StrandClient" ] }, diff --git a/src/neoforge/kotlin/re/lilith/strand/platform/neoforge/StrandNeoForgeCommands.kt b/src/neoforge/kotlin/re/lilith/strand/platform/neoforge/StrandNeoForgeCommands.kt new file mode 100644 index 0000000..f21e0ed --- /dev/null +++ b/src/neoforge/kotlin/re/lilith/strand/platform/neoforge/StrandNeoForgeCommands.kt @@ -0,0 +1,95 @@ +/* + * Strand - Open your Minecraft world to anyone, anywhere. + * Copyright (C) 2026 Lilith Technologies LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +package re.lilith.strand.platform.neoforge + +import com.mojang.brigadier.arguments.StringArgumentType +import com.mojang.brigadier.builder.LiteralArgumentBuilder.literal +import com.mojang.brigadier.builder.RequiredArgumentBuilder.argument +import re.lilith.strand.client.StrandChat.PREFIX +import re.lilith.strand.client.gui.StrandHubScreen +import re.lilith.strand.session.SessionController +import net.minecraft.client.Minecraft +import net.minecraft.commands.CommandSourceStack +import net.minecraft.network.chat.Component +import net.neoforged.neoforge.client.event.RegisterClientCommandsEvent +import net.neoforged.neoforge.common.NeoForge + +object StrandNeoForgeCommands { + + fun register(controller: SessionController) { + NeoForge.EVENT_BUS.addListener { event: RegisterClientCommandsEvent -> + event.dispatcher.register( + literal("strand") + .executes { + openHub(); 1 + } + .then(literal("host").executes { + controller.host(); 1 + }) + .then(literal("stop").executes { + controller.unhost(); 1 + }) + .then(literal("code").executes { ctx -> + val code = controller.currentCode() + feedback(ctx.source, if (code != null) "Invite code: $code" else "You are not hosting.") + 1 + }) + .then(literal("invite") + .then(argument("name", StringArgumentType.word()).executes { ctx -> + controller.invite(StringArgumentType.getString(ctx, "name")); 1 + })) + .then(literal("join") + .then(argument("code", StringArgumentType.word()).executes { ctx -> + controller.joinByCode(StringArgumentType.getString(ctx, "code")); 1 + })) + .then(literal("accept").executes { ctx -> + if (!controller.acceptInvite()) feedback(ctx.source, "No pending invites.") + 1 + }) + .then(literal("decline").executes { ctx -> + if (!controller.declineInvite()) feedback(ctx.source, "No pending invites.") + 1 + }) + .then(literal("invites") + .then(literal("allow").executes { + controller.setInvitesBlocked(false); 1 + }) + .then(literal("block").executes { + controller.setInvitesBlocked(true); 1 + })) + .then(literal("status").executes { ctx -> + val hosting = if (controller.isHosting) "hosting (code ${controller.currentCode()})" else "not hosting" + val blocked = if (controller.invitesBlocked()) "blocked" else "allowed" + val pending = controller.pendingInvites().size + feedback(ctx.source, "Status: $hosting, invites $blocked, $pending pending.") + 1 + }) + ) + } + } + + private fun feedback(source: CommandSourceStack, message: String) { + source.sendSystemMessage(Component.literal("").append(PREFIX).append(" $message")) + } + + private fun openHub() { + val mc = Minecraft.getInstance() + mc.execute { mc.setScreenAndShow(StrandHubScreen(null)) } + } +} diff --git a/src/neoforge/kotlin/re/lilith/strand/platform/neoforge/StrandNeoForgeMod.kt b/src/neoforge/kotlin/re/lilith/strand/platform/neoforge/StrandNeoForgeMod.kt new file mode 100644 index 0000000..8dcbd5d --- /dev/null +++ b/src/neoforge/kotlin/re/lilith/strand/platform/neoforge/StrandNeoForgeMod.kt @@ -0,0 +1,80 @@ +/* + * Strand - Open your Minecraft world to anyone, anywhere. + * Copyright (C) 2026 Lilith Technologies LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +package re.lilith.strand.platform.neoforge + +import re.lilith.strand.StrandConfig +import re.lilith.strand.StrandState +import re.lilith.strand.backend.BackendClient +import re.lilith.strand.client.StrandClientHooks +import re.lilith.strand.eos.EosManager +import re.lilith.strand.session.SessionController +import gg.sona.eos.Eos +import gg.sona.eos.EosNatives +import net.neoforged.bus.api.IEventBus +import net.neoforged.fml.ModContainer +import net.neoforged.fml.common.Mod +import net.neoforged.fml.event.lifecycle.FMLClientSetupEvent +import net.neoforged.fml.loading.FMLPaths +import net.neoforged.neoforge.client.event.ClientTickEvent +import net.neoforged.neoforge.common.NeoForge +import org.slf4j.LoggerFactory + +@Mod("strand") +class StrandNeoForgeMod(modBus: IEventBus, container: ModContainer) { + + private val logger = LoggerFactory.getLogger("strand") + + init { + modBus.addListener(::onClientSetup) + } + + private fun onClientSetup(event: FMLClientSetupEvent) { + EosNatives.baseUrl = "https://eos-cdn.lilith.re" + logger.info("Setting up EOS SDK...") + logger.info("SDK version: ${Eos.version}") + + val config = StrandConfig.load(FMLPaths.CONFIGDIR.get()) + StrandState.config = config + + val backend = BackendClient("https://strand.lilith.re", config.oidcClientId, config.oidcRedirectUri) + val hooks = StrandClientHooks() + val controller = SessionController(config, backend, hooks) + StrandState.controller = controller + + EosManager.init() + + StrandNeoForgeCommands.register(controller) + StrandNeoForgeScreenButtons.register() + + var loggedIn = false + NeoForge.EVENT_BUS.addListener { _: ClientTickEvent.Post -> + if (!loggedIn) { + loggedIn = true + controller.ensureLogin() + } + } + + Runtime.getRuntime().addShutdownHook(Thread { + controller.shutdown() + EosManager.shutdown() + }) + + logger.info("Strand client initialized") + } +} diff --git a/src/neoforge/kotlin/re/lilith/strand/platform/neoforge/StrandNeoForgeScreenButtons.kt b/src/neoforge/kotlin/re/lilith/strand/platform/neoforge/StrandNeoForgeScreenButtons.kt new file mode 100644 index 0000000..66c2118 --- /dev/null +++ b/src/neoforge/kotlin/re/lilith/strand/platform/neoforge/StrandNeoForgeScreenButtons.kt @@ -0,0 +1,44 @@ +/* + * Strand - Open your Minecraft world to anyone, anywhere. + * Copyright (C) 2026 Lilith Technologies LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +package re.lilith.strand.platform.neoforge + +import re.lilith.strand.client.gui.StrandHubScreen +import net.minecraft.client.Minecraft +import net.minecraft.client.gui.components.Button +import net.minecraft.client.gui.screens.PauseScreen +import net.minecraft.client.gui.screens.TitleScreen +import net.minecraft.client.gui.screens.multiplayer.JoinMultiplayerScreen +import net.minecraft.network.chat.Component +import net.neoforged.neoforge.client.event.ScreenEvent +import net.neoforged.neoforge.common.NeoForge + +object StrandNeoForgeScreenButtons { + fun register() { + NeoForge.EVENT_BUS.addListener { event: ScreenEvent.Init.Post -> + val screen = event.screen + if (screen is TitleScreen || screen is JoinMultiplayerScreen || screen is PauseScreen) { + val client = Minecraft.getInstance() + val button = Button.builder(Component.literal("Strand")) { _ -> + client.setScreenAndShow(StrandHubScreen(screen)) + }.bounds(screen.width - 104, 4, 100, 20).build() + event.addListener(button) + } + } + } +} diff --git a/stonecutter.gradle.kts b/stonecutter.gradle.kts new file mode 100644 index 0000000..22a9475 --- /dev/null +++ b/stonecutter.gradle.kts @@ -0,0 +1,13 @@ +plugins { + id("dev.kikugie.stonecutter") +} + +stonecutter active "26.2-fabric" + +// See https://stonecutter.kikugie.dev/wiki/config/params +stonecutter parameters { + swaps["mod_version"] = "\"${property("mod_version")}\"" + swaps["minecraft_version"] = "\"${node.metadata.version}\"" + + constants.match(current.project.substringAfterLast('-'), "fabric", "neoforge") +} \ No newline at end of file