getRecipeContext method always returns null
wintercoresystem opened this issue ยท 3 comments
Bug Report: getRecipeContext Always Returns Null
Issue Description
The getRecipeContext method consistently returns null, causing dependent methods in EMIScreenManager (such as Stack Tree functionality) to fail.
Steps to Reproduce
- Trigger a method in
EMIScreenManagerthat relies ongetRecipeContext(e.g., Stack Tree). - Observe failures due to missing context (Tree won't show because context is null).
- Debug logs confirm
contextisnullfor all interactions.
Actual Behavior
- Debug output:
stack: dev.emi.emi.api.stack.EmiStackInteraction@77366ad3 ingredient: minecraft:oak_planks x31 context: null stack: dev.emi.emi.api.stack.EmiStackInteraction@16086a5d ingredient: dev.emi.emi.api.stack.TagEmiIngredient@d6342d48 context: null - Methods using
contextfail silently or throw errors.
Expected Behavior
getRecipeContext should return a valid RecipeContext object (non-null) when interacting with stacks/ingredients, enabling features like Stack Tree to function correctly.
Environment
- Mod Version: emi 1.1.22-SNAPSHOT+1.21.1+fabric
- Game Version: Minecraft 1.21
- Loader: Fabric
- Reproducibility: Consistent
Additional Context
- Code Snippet (from logs):
if (EmiConfig.cheatMode) { ... } System.out.printf("stack: %s\n", stack); System.out.printf("ingredient: %s\n", ingredient); System.out.printf("context: %s\n", context); // Always null if (function.apply(EmiConfig.viewRecipes)) { ... }
Recipe context only exists on stacks that have an associated recipe, like recipe favorites. A majority of stacks will have a null recipe context.
Am I missing something then? I set default recipe and favorite input and output ingredients, still got null.
Output in stdout:
stack: dev.emi.emi.api.stack.EmiStackInteraction@72fa83b
ingredient: minecraft:oak_log x6
context: null
stack: dev.emi.emi.api.stack.EmiStackInteraction@3ea102
ingredient: minecraft:torch x64
context: null
stack: dev.emi.emi.api.stack.EmiStackInteraction@44f1972c
ingredient: minecraft:stick x11
context: null
stack: dev.emi.emi.api.stack.EmiStackInteraction@3a02dd8c
ingredient: minecraft:coal