diff --git a/build.gradle.kts b/build.gradle.kts index 33fa16e..294e52a 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -10,7 +10,7 @@ plugins { kotlin("jvm") version "1.9.10" kotlin("plugin.serialization") version "1.9.10" - id("gg.essential.loom") version "0.10.0.+" + id("org.polyfrost.loom") version "1.6.polyfrost.5" id("dev.architectury.architectury-pack200") version "0.1.3" id("com.github.johnrengelman.shadow") version "8.1.1" } @@ -55,10 +55,10 @@ loom { pack200Provider.set(Pack200Adapter()) mixinConfig("spice.mixins.json") } - launchConfigs { + runConfigs { "client" { property("mixin.debug", "true") - arg("--tweakClass", "org.spongepowered.asm.launch.MixinTweaker") + programArgs("--tweakClass", "org.spongepowered.asm.launch.MixinTweaker") } remove(getByName("server")) } @@ -82,7 +82,6 @@ dependencies { implementation("org.spongepowered:mixin:0.7.11-SNAPSHOT") { isTransitive = false } - annotationProcessor("org.spongepowered:mixin:0.8.5-SNAPSHOT") implementation("org.ow2.asm:asm-tree:9.7") @@ -118,7 +117,7 @@ val remapJar by tasks.named("remapJar") { from(tasks.shadowJar) - input.set(tasks.shadowJar.get().archiveFile) + inputFile.set(tasks.shadowJar.get().archiveFile) } val weaveJar by tasks.register("weaveJar") { diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index c1962a7..e644113 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 a80b22c..a441313 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.6-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew old mode 100644 new mode 100755 index aeb74cb..1aa94a4 --- a/gradlew +++ b/gradlew @@ -83,7 +83,8 @@ done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# 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 # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -130,10 +131,13 @@ location of your Java installation." fi else JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + 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. @@ -141,7 +145,7 @@ 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=SC3045 + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -149,7 +153,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -198,11 +202,11 @@ 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 -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_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" \ diff --git a/gradlew.bat b/gradlew.bat index 93e3f59..25da30d 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -43,11 +43,11 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +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 goto fail @@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +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 goto fail diff --git a/settings.gradle.kts b/settings.gradle.kts index ebb5bd4..59e255c 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -2,25 +2,9 @@ pluginManagement { repositories { mavenCentral() gradlePluginPortal() - maven("https://oss.sonatype.org/content/repositories/snapshots") - maven("https://maven.architectury.dev/") - maven("https://maven.fabricmc.net") - maven("https://maven.minecraftforge.net/") - maven("https://repo.spongepowered.org/maven/") - maven("https://repo.sk1er.club/repository/maven-releases/") + maven("https://repo.polyfrost.org/releases") } - resolutionStrategy { - eachPlugin { - when (requested.id.id) { - "gg.essential.loom" -> useModule("gg.essential:architectury-loom:${requested.version}") - } - } - } -} - -plugins { - id("org.gradle.toolchains.foojay-resolver-convention") version("0.6.0") } -rootProject.name = "spice" +rootProject.name = "Spice" diff --git a/src/main/java/wtf/zani/spice/mixin/common/GuiOverlayDebugMixin.java b/src/main/java/wtf/zani/spice/mixin/common/GuiOverlayDebugMixin.java index aaf3f12..ebe6312 100644 --- a/src/main/java/wtf/zani/spice/mixin/common/GuiOverlayDebugMixin.java +++ b/src/main/java/wtf/zani/spice/mixin/common/GuiOverlayDebugMixin.java @@ -17,6 +17,6 @@ public abstract class GuiOverlayDebugMixin { @Inject(method = "getDebugInfoRight", locals = LocalCapture.CAPTURE_FAILHARD, at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiOverlayDebug;isReducedDebug()Z")) private void addSpiceDebugInfo(CallbackInfoReturnable> cir, long maxMemory, long totalMemory, long freeMemory, long usedMemory, List lines) { - DebugHelper.applyExtraDebugInfo$spice(lines); + DebugHelper.applyExtraDebugInfo$Spice(lines); } } diff --git a/src/main/java/wtf/zani/spice/mixin/common/MinecraftMixin.java b/src/main/java/wtf/zani/spice/mixin/common/MinecraftMixin.java index b949a6e..de839e9 100644 --- a/src/main/java/wtf/zani/spice/mixin/common/MinecraftMixin.java +++ b/src/main/java/wtf/zani/spice/mixin/common/MinecraftMixin.java @@ -27,7 +27,7 @@ public abstract class MinecraftMixin { @Inject(method = "addGraphicsAndWorldToCrashReport", at = @At("HEAD")) private void addSpiceInfo(CrashReport instance, CallbackInfoReturnable cir) { instance.getCategory().addCrashSectionCallable("Spice", Spice::getVersion); - instance.getCategory().addCrashSectionCallable("GLFW", Spice::getGlfwVersion$spice); + instance.getCategory().addCrashSectionCallable("GLFW", Spice::getGlfwVersion$Spice); } // in case we cause a crash too early @@ -60,6 +60,6 @@ private void fixupCrashReport(CrashReportCategory instance, String name, Callabl @Inject(method = "startGame", at = @At("HEAD")) private void initialize(CallbackInfo ci) { - Spice.initialize$spice(); + Spice.initialize$Spice(); } } diff --git a/src/main/java/wtf/zani/spice/mixin/lwjgl3/GuiControlsMixin.java b/src/main/java/wtf/zani/spice/mixin/lwjgl3/GuiControlsMixin.java index fa01b60..701e6a3 100644 --- a/src/main/java/wtf/zani/spice/mixin/lwjgl3/GuiControlsMixin.java +++ b/src/main/java/wtf/zani/spice/mixin/lwjgl3/GuiControlsMixin.java @@ -22,7 +22,7 @@ public abstract class GuiControlsMixin extends GuiScreen { private static GameSettings.Options[] optionsArr; @Unique - private final Options spice$options = Spice.getOptions$spice(); + private final Options spice$options = Spice.getOptions$Spice(); @Unique private GuiButton spice$rawInputButton; @@ -47,7 +47,7 @@ private void handleAction(GuiButton button, CallbackInfo ci) { if (!Mouse.isRawInputSupported()) return; if (button.id == 200) { - Spice.saveOptions$spice(); + Spice.getOptions$Spice(); } if (button.id == spice$rawInputButton.id) { diff --git a/src/main/java/wtf/zani/spice/mixin/lwjgl3/MinecraftMixin.java b/src/main/java/wtf/zani/spice/mixin/lwjgl3/MinecraftMixin.java index 77e9ed2..4ca1358 100644 --- a/src/main/java/wtf/zani/spice/mixin/lwjgl3/MinecraftMixin.java +++ b/src/main/java/wtf/zani/spice/mixin/lwjgl3/MinecraftMixin.java @@ -14,6 +14,6 @@ public abstract class MinecraftMixin { private void setupRawInput(CallbackInfo ci) { if (!Mouse.isRawInputSupported()) return; - Mouse.setRawInput(Spice.getOptions$spice().rawInput); + Mouse.setRawInput(Spice.getOptions$Spice().rawInput); } } diff --git a/src/main/java/wtf/zani/spice/mixin/lwjgl3/MouseHelperMixin.java b/src/main/java/wtf/zani/spice/mixin/lwjgl3/MouseHelperMixin.java index 2916dd4..9a7571d 100644 --- a/src/main/java/wtf/zani/spice/mixin/lwjgl3/MouseHelperMixin.java +++ b/src/main/java/wtf/zani/spice/mixin/lwjgl3/MouseHelperMixin.java @@ -18,7 +18,7 @@ public abstract class MouseHelperMixin { @Inject(method = "mouseXYChange", at = @At("HEAD"), cancellable = true) private void mouseUpdate(CallbackInfo ci) { - if (Spice.getPlatform$spice() != Platform.Weave) return; + if (Spice.getPlatform$Spice() != Platform.Weave) return; deltaX = Mouse.getDX(); deltaY = Mouse.getDY();