Fix recipes in EMI disappearing under certain conditions - #55
Fix recipes in EMI disappearing under certain conditions#55andriihorpenko wants to merge 1 commit into
Conversation
|
I see, but I barely used emi, so whats the cost of using |
e88def4 to
d3f0ed9
Compare
|
I reverted some of my late-minute changes and switched to I feel like the whole EMI compat in LDLib should be revisited at some point in the future, as it has other issues:
Understandably, this all comes from "unified" recipe viewers compat layer, hence some features are stripped. Maybe in the future XEI layer could be greatly enhanced, all points above are pure cosmetics (apart from this PR, where some recipes are not shown at all). |
Description
EMI lets stacks be disabled entirely from its index (via index/stacks data, or
EmiInitRegistry#disableStackfrom a plugin). When baking recipes, EMI discards any recipe holding an ingredient whose stacks are all disabled. A tag ingredient therefore survives as long as one of its variants is still enabled.Cause
Mods using LDLib hand the stacks a single slot accepts, already resolved from the tag (in MBD2,
ItemRecipeCapabilitypassesArrays.stream(ingredient.getItems())).EMIRecipeIngredientHandlerreports each of those as its ownsingle-stack ingredient rather than one ingredient holding all the variants. Whenever EMI encounters a disabled single-stack ingredient, it drops the entire recipe, even though every other variant is still available (see related EMI code)
Solution
This PR merges all the variants back into a
ListEmiIngredientviaEmiIngredient#offactory. Similar approach was already used in LDLib, but in a different place (see related LDLib code). That approach was also changed:ListEmiIngredientwas replaced withEmiIngredient#offactory so that disabled ingredients won't be shown on separate EMI possible items list screen.Reproduction
Minimal modpack:
LDLibRepro.zip
Add/remove
kubejs/assets/emi/index/stacks/repro.jsonto see changes. Adding a file disablesminecraft:oak_planksin EMI, removing the file brings them back.Before the PR
Look at
minecraft:torchrecipe in EMI: recipe WILL NOT be shown in EMI forrepro:emirecipe typeAfter the PR
Look at
minecraft:torchrecipe in EMI: recipe WILL be shown in EMI forrepro:emirecipe typeNotes
ScrollDataSource(see related MBD2 code). For that to be fixed, MBD2 has to do filtering on its side, but that's too much machinery just for cosmetics.