Skip to content

Conversation

Copy link

Copilot AI commented Feb 12, 2026

Stone Cutter and other crafting overrides throw IllegalArgumentException when given incompatible recipes (e.g., 3x3 recipe on a 1-slot device), crashing the game and locking the save.

Changes

  • Wrap crafting override execution in try-catch: Return false on IllegalArgumentException instead of propagating, allowing the system to gracefully skip invalid recipes
  • Minor formatting fix: Spacing correction in insertLoopNonBlocking condition
// Before
if (craftingProcessOverride.isApplicable(target)) {
    return craftingProcessOverride.craft(targetGetter, ingredients, recipe, this.resultsSink, craftingJob, simulate);
}

// After  
if (craftingProcessOverride.isApplicable(target)) {
    try {
        return craftingProcessOverride.craft(targetGetter, ingredients, recipe, this.resultsSink, craftingJob, simulate);
    } catch (IllegalArgumentException e) {
        return false;
    }
}

Original fix by @Niikelion in #179 (1.21 branch). This applies the same solution to 1.20.1.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • maven.minecraftforge.net
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED -Dfile.encoding=UTF-8 -Duser.country (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@CLAassistant
Copy link

CLAassistant commented Feb 12, 2026

CLA assistant check
All committers have signed the CLA.

@rubensworks rubensworks marked this pull request as ready for review February 12, 2026 15:41
Copilot AI changed the title [WIP] Fix issue 178 using solution from issue 179 Catch IllegalArgumentException in crafting process overrides to prevent crash on invalid recipes Feb 12, 2026
Copilot AI requested a review from rubensworks February 12, 2026 15:42
@rubensworks rubensworks merged commit 9eae868 into master-1.20-lts Feb 12, 2026
3 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants