-
Notifications
You must be signed in to change notification settings - Fork 5
Fix fluid encoder JEI support not working #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: solidDoWant <fred.heinecke@yahoo.com>
Signed-off-by: solidDoWant <fred.heinecke@yahoo.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Fixes JEI “Move Items” failing to transfer fluids into AE2’s native Pattern Terminal when EnderCore/EnderIO affects plugin load order, by replacing the runtime recipe transfer handler lookup instead of trying to mutate JEI’s startup snapshot.
Changes:
- Added a JEI
RecipeRegistryMixin to override the handler returned forContainerPatternTerm. - Simplified the JEI plugin registration to only register the Extended Pattern Terminal handler via public API.
- Adjusted recipe transfer logic to avoid slot conflicts by forcing “processing mode” for fluids and adding null-guards.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
src/main/resources/mixins.gregtechenergistics.json |
Registers the new JEI mixin so runtime handler interception is applied. |
src/main/java/com/soliddowant/gregtechenergistics/mixins/jei/RecipeRegistryMixin.java |
Intercepts RecipeRegistry.getRecipeTransferHandler and swaps AE2’s handler for the mod’s handler for ContainerPatternTerm. |
src/main/java/com/soliddowant/gregtechenergistics/integration/jei/RecipeTransferHandler.java |
Changes transfer behavior for fluids and server-side merging/preserve-slot logic. |
src/main/java/com/soliddowant/gregtechenergistics/integration/jei/JeiPlugin.java |
Removes reflection-based registry mutation; registers only the extended terminal handler. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/main/java/com/soliddowant/gregtechenergistics/integration/jei/RecipeTransferHandler.java
Show resolved
Hide resolved
src/main/java/com/soliddowant/gregtechenergistics/integration/jei/RecipeTransferHandler.java
Outdated
Show resolved
Hide resolved
src/main/java/com/soliddowant/gregtechenergistics/integration/jei/JeiPlugin.java
Outdated
Show resolved
Hide resolved
|
@solidDoWant I've opened a new pull request, #14, to work on those changes. Once the pull request is ready, I'll request review from you. |
* 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>
Signed-off-by: solidDoWant <fred.heinecke@yahoo.com>
Signed-off-by: solidDoWant <fred.heinecke@yahoo.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/main/java/com/soliddowant/gregtechenergistics/mixins/jei/RecipeRegistryMixin.java
Show resolved
Hide resolved
src/main/java/com/soliddowant/gregtechenergistics/integration/jei/JeiPlugin.java
Outdated
Show resolved
Hide resolved
|
@solidDoWant I've opened a new pull request, #15, to work on those changes. Once the pull request is ready, I'll request review from you. |
Signed-off-by: solidDoWant <fred.heinecke@yahoo.com>
…EI (#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>
Signed-off-by: solidDoWant <fred.heinecke@yahoo.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/main/java/com/soliddowant/gregtechenergistics/integration/jei/RecipeTransferHandler.java
Show resolved
Hide resolved
src/main/java/com/soliddowant/gregtechenergistics/integration/jei/RecipeTransferHandler.java
Show resolved
Hide resolved
src/main/java/com/soliddowant/gregtechenergistics/mixins/jei/RecipeRegistryMixin.java
Show resolved
Hide resolved
|
@solidDoWant I've opened a new pull request, #16, to work on those changes. Once the pull request is ready, I'll request review from you. |
Signed-off-by: solidDoWant <fred.heinecke@yahoo.com>
JEI's "Move Items" button failed to transfer fluids to the native AE2 Pattern Terminal when EnderCore/EnderIO was present. Fluids were completely omitted from the pattern, while items worked correctly. The Extended Pattern Terminal was unaffected.
Root Cause
JEI's RecipeRegistry creates an immutable snapshot of recipe transfer handlers during construction. The original approach attempted to replace AE2's handler via reflection by modifying RecipeTransferRegistry, but this had two fatal flaws:
@JEIPluginclasses in an undefined order (fromASMDataTable.getAll()which returns an unorderedSet). Sometimes our plugin loaded before AE2's, sometimes after.RecipeRegistryalready held a frozenImmutableTablesnapshot taken during startup. Runtime modifications were never seen by the actual handler lookup code.Solution
Implemented a Mixin (
RecipeRegistryMixin) that interceptsRecipeRegistry.getRecipeTransferHandler()at runtime:ContainerPatternTermChanges
Testing
Verified with EnderCore/EnderIO enabled across multiple restarts - fluids now consistently appear as fluid encoder items when using JEI's "Move Items" button on the native AE2 Pattern Terminal.