Skip to content

Fix hasInputFluids check to prevent shaped recipe compression#14

Merged
solidDoWant merged 2 commits into
fix/jei-plugin-loading-1from
copilot/sub-pr-13
Jan 20, 2026
Merged

Fix hasInputFluids check to prevent shaped recipe compression#14
solidDoWant merged 2 commits into
fix/jei-plugin-loading-1from
copilot/sub-pr-13

Conversation

Copilot AI commented Jan 20, 2026

Copy link
Copy Markdown
Contributor

JEIPacket serializes fixed-size arrays with empty NBT tags for null slots, so inputFluids.length > 0 is always true even when no fluids exist. This made preserveSlots always false, breaking shaped crafting by compressing item positions.

Changes

  • Added hasAnyFluids() helper - Scans array for any non-null FluidStack with amount > 0
  • Fixed fluid detection logic - Both hasInputFluids and hasOutputFluids now use hasAnyFluids() instead of length checks
protected static boolean hasAnyFluids(@Nullable FluidStack[] fluids) {
    if (fluids == null)
        return false;
    
    for (FluidStack fluid : fluids) {
        if (fluid != null && fluid.amount > 0)
            return true;
    }
    
    return false;
}

This ensures shaped recipes preserve slot positions when no fluids are present, while still switching to processing mode when fluids exist.


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

Co-authored-by: solidDoWant <16456946+solidDoWant@users.noreply.github.com>

Copilot AI commented Jan 20, 2026

Copy link
Copy Markdown
Contributor Author

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

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:

  • nexus.gtnewhorizons.com
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --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-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.util=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 -Xmx5G -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant -cp /home/REDACTED/.gradle/wrapper/dists/gradle-8.9-bin/90cnw93cvbtalezasaz0blq0a/gradle-8.9/lib/gradle-daemon-main-8.9.jar -javaagent:/home/REDACTED/.gradle/wrapper/dists/gradle-8.9-bin/90cnw93cvbtalezasaz0blq0a/gradle-8.9/lib/agents/gradle-instrumentation-agent-8.9.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 8.9 (dns block)

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

Copilot AI changed the title [WIP] WIP address feedback on fluid encoder JEI support fix Fix hasInputFluids check to prevent shaped recipe compression Jan 20, 2026
Copilot AI requested a review from solidDoWant January 20, 2026 08:08
@solidDoWant solidDoWant marked this pull request as ready for review January 20, 2026 08:10
@solidDoWant solidDoWant merged commit 0debb22 into fix/jei-plugin-loading-1 Jan 20, 2026
solidDoWant added a commit that referenced this pull request Jan 20, 2026
* try mixin approach

Signed-off-by: solidDoWant <fred.heinecke@yahoo.com>

* remove d ebug code

Signed-off-by: solidDoWant <fred.heinecke@yahoo.com>

* Fix hasInputFluids check to prevent shaped recipe compression (#14)

* Initial plan

* Fix hasInputFluids and hasOutputFluids calculation

Co-authored-by: solidDoWant <16456946+solidDoWant@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: solidDoWant <16456946+solidDoWant@users.noreply.github.com>

* rm dead code

Signed-off-by: solidDoWant <fred.heinecke@yahoo.com>

* rm old import, warning

Signed-off-by: solidDoWant <fred.heinecke@yahoo.com>

* address PR comments

Signed-off-by: solidDoWant <fred.heinecke@yahoo.com>

* Gate JEI mixin behind mod presence check to prevent crashes without JEI (#15)

* Initial plan

* Add IMixinConfigPlugin to gate JEI mixin behind mod presence check

Co-authored-by: solidDoWant <16456946+solidDoWant@users.noreply.github.com>

* Use startsWith for more precise JEI mixin package detection

Co-authored-by: solidDoWant <16456946+solidDoWant@users.noreply.github.com>

* Make JEI package detection more robust using mixinPackage parameter

Co-authored-by: solidDoWant <16456946+solidDoWant@users.noreply.github.com>

* Extract JEI constants and fix formatting

Co-authored-by: solidDoWant <16456946+solidDoWant@users.noreply.github.com>

* Add documentation for JEI package convention

Co-authored-by: solidDoWant <16456946+solidDoWant@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: solidDoWant <16456946+solidDoWant@users.noreply.github.com>

* fix import

Signed-off-by: solidDoWant <fred.heinecke@yahoo.com>

* Statically init GT_ENERGISTICS_HANDLER

Signed-off-by: solidDoWant <fred.heinecke@yahoo.com>

---------

Signed-off-by: solidDoWant <fred.heinecke@yahoo.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: solidDoWant <16456946+solidDoWant@users.noreply.github.com>
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.

2 participants