From 569b2a29dbec13c88e2f59fd42373b9c2d9a6680 Mon Sep 17 00:00:00 2001 From: Su5eD <su5ed@outlook.com> Date: Mon, 16 Dec 2024 16:43:20 +0100 Subject: [PATCH] Update ModDevGradle --- .../sinytra/adapter/patch/analysis/InstructionMatcher.java | 3 +++ gradle.properties | 4 ++-- gradle/wrapper/gradle-wrapper.properties | 2 +- .../main/java/org/sinytra/adapter/gradle/AdapterPlugin.java | 2 +- test/build.gradle.kts | 2 +- userdev/build.gradle.kts | 2 +- .../org/sinytra/adapter/userdev/AdapterUserdevPlugin.java | 2 +- 7 files changed, 10 insertions(+), 7 deletions(-) diff --git a/definition/src/main/java/org/sinytra/adapter/patch/analysis/InstructionMatcher.java b/definition/src/main/java/org/sinytra/adapter/patch/analysis/InstructionMatcher.java index 80c5147..ca9bbb4 100644 --- a/definition/src/main/java/org/sinytra/adapter/patch/analysis/InstructionMatcher.java +++ b/definition/src/main/java/org/sinytra/adapter/patch/analysis/InstructionMatcher.java @@ -28,6 +28,9 @@ public String findReplacement(List<String> cleanCallOrder, List<String> dirtyCal return null; } + if (this.after.isEmpty()) { + return null; + } MethodInsnNode nextMethodCall = MethodCallAnalyzer.findFirstInsn(this.after.getFirst(), MethodInsnNode.class, MethodCallAnalyzer.FORWARD); if (nextMethodCall == null) { return null; diff --git a/gradle.properties b/gradle.properties index 642e020..aa7a9af 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,7 +7,7 @@ org.gradle.caching=true org.gradle.configuration-cache=true versionMc=1.21.1 -versionNeoForge=21.1.5 -versionModDevGradle=2.0.9-beta +versionNeoForge=21.1.90 +versionModDevGradle=2.0.52-beta runtimeVersion=1.0.0 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index a441313..e2847c8 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.8-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/plugin/src/main/java/org/sinytra/adapter/gradle/AdapterPlugin.java b/plugin/src/main/java/org/sinytra/adapter/gradle/AdapterPlugin.java index f49a7f1..84ca6f2 100644 --- a/plugin/src/main/java/org/sinytra/adapter/gradle/AdapterPlugin.java +++ b/plugin/src/main/java/org/sinytra/adapter/gradle/AdapterPlugin.java @@ -28,7 +28,7 @@ private static void applyPlugin(Project project, AppliedPlugin plugin) { TaskProvider<CreateBinpatchedArtifactTask> createBinpatchedArtifactTask = project.getTasks().named("createBinpatchedArtifact", CreateBinpatchedArtifactTask.class); project.getTasks().register("generateAdapterData", AdapterCompareJarTask.class, task -> { - task.getCleanJar().fileProvider(neoForge.getNeoFormRuntime().getAdditionalResults().map(p -> p.get("vanillaDeobfuscated"))); + task.getCleanJar().fileProvider(neoForge.getAdditionalMinecraftArtifacts().map(p -> p.get("vanillaDeobfuscated"))); task.getDirtyJar().set(createBinpatchedArtifactTask.flatMap(CreateBinpatchedArtifactTask::getOutputFile)); }); } diff --git a/test/build.gradle.kts b/test/build.gradle.kts index 61087d5..1915af1 100644 --- a/test/build.gradle.kts +++ b/test/build.gradle.kts @@ -41,7 +41,7 @@ tasks { test { useJUnitPlatform() systemProperty("adapter.definition.paramdiff.debug", true) - systemProperty("adapter.clean.path", neoForge.neoFormRuntime.additionalResults.getting("vanillaDeobfuscated").get().absolutePath) + systemProperty("adapter.clean.path", neoForge.additionalMinecraftArtifacts.getting("vanillaDeobfuscated").get().absolutePath) systemProperty("forge.logging.console.level", "debug") outputs.upToDateWhen { false } } diff --git a/userdev/build.gradle.kts b/userdev/build.gradle.kts index 58cca7c..ffeb1d8 100644 --- a/userdev/build.gradle.kts +++ b/userdev/build.gradle.kts @@ -6,7 +6,7 @@ plugins { } group = "org.sinytra.adapter" -version = "1.2-SNAPSHOT" +version = "1.2.1-SNAPSHOT" val versionModDevGradle: String by Properties().also { file("../gradle.properties").bufferedReader().use(it::load) } diff --git a/userdev/src/main/java/org/sinytra/adapter/userdev/AdapterUserdevPlugin.java b/userdev/src/main/java/org/sinytra/adapter/userdev/AdapterUserdevPlugin.java index 170a3b3..3d4df81 100644 --- a/userdev/src/main/java/org/sinytra/adapter/userdev/AdapterUserdevPlugin.java +++ b/userdev/src/main/java/org/sinytra/adapter/userdev/AdapterUserdevPlugin.java @@ -36,7 +36,7 @@ public static void applyPlugin(Project project) { }); File requestedOutput = project.file("build/createCleanArtifact/minecraft-renamed.jar"); - neoForge.getNeoFormRuntime().getAdditionalResults().put("vanillaDeobfuscated", requestedOutput); + neoForge.getAdditionalMinecraftArtifacts().put("vanillaDeobfuscated", requestedOutput); TaskProvider<ExtractBinPatches> extractBinPatches = project.getTasks().register("extractBinPatches", ExtractBinPatches.class, task -> { task.setGroup("sinytra");