From 7336d7d4af3bd164fb9ecbe7745e641ed043e26c Mon Sep 17 00:00:00 2001 From: rutaji Date: Thu, 9 Jul 2026 16:29:46 +0200 Subject: [PATCH 1/2] updated dependencies --- build.gradle | 24 +----------------------- dependencies.gradle | 10 ++++++---- 2 files changed, 7 insertions(+), 27 deletions(-) diff --git a/build.gradle b/build.gradle index d3a4bc1..dca787e 100644 --- a/build.gradle +++ b/build.gradle @@ -53,7 +53,7 @@ plugins { id 'com.diffplug.spotless' version '6.13.0' apply false // 6.13.0 is the last jvm8 supporting version id 'com.modrinth.minotaur' version '2.+' apply false id 'com.matthewprenger.cursegradle' version '1.4.0' apply false - id 'com.gtnewhorizons.retrofuturagradle' version '1.3.27' + id 'com.gtnewhorizons.retrofuturagradle' version '1.4.9' } print("You might want to check out './gradlew :faq' if your build fails.\n") @@ -1059,28 +1059,6 @@ idea { if (coreModClass) { coreModArgs = ' "-Dfml.coreMods.load=' + modGroup + '.' + coreModClass + '"' } - "Run Client (IJ Native)"(Application) { - mainClass = "GradleStart" - moduleName = project.name + ".ideVirtualMain" - afterEvaluate { - workingDirectory = tasks.runClient.workingDir.absolutePath - programParameters = tasks.runClient.calculateArgs(project).collect { '"' + it + '"' }.join(' ') - jvmArgs = tasks.runClient.calculateJvmArgs(project).collect { '"' + it + '"' }.join(' ') + - ' ' + tasks.runClient.systemProperties.collect { '"-D' + it.key + '=' + it.value.toString() + '"' }.join(' ') + - coreModArgs - } - } - "Run Server (IJ Native)"(Application) { - mainClass = "GradleStartServer" - moduleName = project.name + ".ideVirtualMain" - afterEvaluate { - workingDirectory = tasks.runServer.workingDir.absolutePath - programParameters = tasks.runServer.calculateArgs(project).collect { '"' + it + '"' }.join(' ') - jvmArgs = tasks.runServer.calculateJvmArgs(project).collect { '"' + it + '"' }.join(' ') + - ' ' + tasks.runServer.systemProperties.collect { '"-D' + it.key + '=' + it.value.toString() + '"' }.join(' ') + - coreModArgs - } - } } compiler.javac { afterEvaluate { diff --git a/dependencies.gradle b/dependencies.gradle index 0d0b54c..2ada993 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -34,11 +34,13 @@ * For more details, see https://docs.gradle.org/8.0.1/userguide/java_library_plugin.html#sec:java_library_configurations_graph */ dependencies { - api('com.github.GTNewHorizons:CodeChickenCore:1.3.10:dev') + api('com.github.GTNewHorizons:CodeChickenCore:1.4.10:dev') // api('com.github.CoFH:cofhcore:3.1.4-329:dev') - api("com.github.GTNewHorizons:NotEnoughItems:2.6.52-GTNH:dev") - api('com.github.GTNewHorizons:Hodgepodge:2.5.86:dev') - api('com.github.GTNewHorizons:GT5-Unofficial:5.09.50.111:dev') + api("com.github.GTNewHorizons:NotEnoughItems:2.8.44-GTNH:dev") + api('com.github.GTNewHorizons:Hodgepodge:2.6.112:dev') + api('com.github.GTNewHorizons:GT5-Unofficial:5.09.51.482:dev'){ + exclude group: 'com.github.GTNewHorizons', module: 'CodeChickenLib' + } // Random Extra deps for testing with more items // api('com.github.GTNewHorizons:GTNHLib:0.5.23:dev') From f5847ba53850e330442123b62b370196f674c6b2 Mon Sep 17 00:00:00 2001 From: prawn666 <57028387+prawn666@users.noreply.github.com> Date: Sun, 23 Aug 2026 12:49:43 +0200 Subject: [PATCH 2/2] Fix NoSuchFieldError: itemRegistry crashing recipe dump on GTNH 2.8.4 Item.itemRegistry is renamed/removed by this modpack's coremods at runtime, so RecipeDumpContext's static initializer threw NoSuchFieldError as soon as a dump started. The exception was silently swallowed by the worker thread's default uncaught exception handler, so the dump looked like it was hanging: file created (0 bytes), one placeholder -1/-1 progress tick, then nothing -- no crash, no log line. - Use the stable public Forge API GameData.getItemRegistry() instead of the raw Item.itemRegistry field. - Log dump failures properly (overall crash + per-item failures) so a single broken recipe handler no longer silently truncates the whole (multi-hour) dump. Built and verified against GT_New_Horizons_2.8.4_Java_17-25 (the exact dependency versions already updated in this fork): CodeChickenCore 1.4.10, NotEnoughItems 2.8.44-GTNH, Hodgepodge 2.6.112, GT5-Unofficial 5.09.51.482. Full 56028-recipe dump now completes normally. --- .../java/com/hermanoid/nerd/RecipeDumper.java | 28 +++++++++++++++++-- .../RecipeDumpContext.java | 5 +++- 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/hermanoid/nerd/RecipeDumper.java b/src/main/java/com/hermanoid/nerd/RecipeDumper.java index f207429..3a3f910 100644 --- a/src/main/java/com/hermanoid/nerd/RecipeDumper.java +++ b/src/main/java/com/hermanoid/nerd/RecipeDumper.java @@ -9,6 +9,7 @@ import java.util.stream.Stream; import net.minecraft.item.ItemStack; +import net.minecraft.util.ChatComponentText; import net.minecraft.util.ChatComponentTranslation; import org.apache.commons.lang3.NotImplementedException; @@ -113,7 +114,18 @@ public Stream getQueryDumps(List items) { // react well return items.stream() .map(this::performQuery) - .map(this::extractJsonRecipeData); + .map(qr -> { + try { + return extractJsonRecipeData(qr); + } catch (Throwable t) { + // One bad handler shouldn't sink the whole (multi-hour) dump; log and keep going. + NEIClientConfig.logger + .error("NERD: failed to dump recipes for item {} (query #{})", qr.targetStack, dumpedQueries, t); + JsonObject fallback = new JsonObject(); + fallback.addProperty("nerdError", t.toString()); + return fallback; + } + }); } @Override @@ -138,6 +150,7 @@ private void doDumpJson(File file) { List items = ItemList.items; totalQueries = items.size(); dumpedQueries = 0; + NEIClientConfig.logger.info("NERD: starting recipe dump, ItemList.items.size() = {}", totalQueries); try { writer = new FileWriter(file); @@ -211,13 +224,24 @@ public void dumpJson(File file) { dumpActive = true; TimerTask progressTask = getProgressTask(); Thread workerThread = new Thread(() -> { + boolean ok = false; try { doDumpJson(file); + ok = true; + } catch (Throwable t) { + // Previously this exception was silently swallowed by the JVM's default uncaught + // exception handler: no crash, no log line, just a truncated output file. Log it properly. + NEIClientConfig.logger.error("NERD: recipe dump failed", t); } finally { dumpActive = false; progressTask.cancel(); } - NEIClientUtils.printChatMessage(new ChatComponentTranslation("nei.options.tools.dump.recipes.complete")); + if (ok) { + NEIClientUtils + .printChatMessage(new ChatComponentTranslation("nei.options.tools.dump.recipes.complete")); + } else { + NEIClientUtils.printChatMessage(new ChatComponentText("NERD: recipe dump failed, see log for details")); + } }); workerThread.start(); } diff --git a/src/main/java/com/hermanoid/nerd/stack_serialization/RecipeDumpContext.java b/src/main/java/com/hermanoid/nerd/stack_serialization/RecipeDumpContext.java index f6830e9..b4c0800 100644 --- a/src/main/java/com/hermanoid/nerd/stack_serialization/RecipeDumpContext.java +++ b/src/main/java/com/hermanoid/nerd/stack_serialization/RecipeDumpContext.java @@ -24,12 +24,15 @@ import com.google.gson.reflect.TypeToken; import codechicken.nei.util.NBTJson; +import cpw.mods.fml.common.registry.GameData; import gregtech.api.enums.Materials; import gregtech.common.fluid.GTFluid; public class RecipeDumpContext { - private static final RegistryNamespaced itemRegistry = Item.itemRegistry; + // Item.itemRegistry is renamed/removed by this modpack's coremods (NoSuchFieldError at runtime); + // GameData.getItemRegistry() is the stable public Forge API for the same registry. + private static final RegistryNamespaced itemRegistry = GameData.getItemRegistry(); private static final Type fluidType = new TypeToken() {}.getType(); public Map dumpedItems = new HashMap<>();