MAD BER always renders a /dank/null if no recipe exists
The default state of the BER is to just render a /dank/null (only if the mod is present of course).
The reason this happens is actually a bug in /dank/null, which causes some of their recipes to always match the MAD container, which in turn leads to the BER thinking it found the recipe to display. The root cause is a bug in /dank/null here (it should use inventory.getWidth()/inventory.getHeight() instead of the static 3).
This does not exclusively cause a problem in the BER, stuff like that also happens:
There are a few ways we can proceed from here:
- Ignore it, testing in Nucleon showed that /dank/null is the only mod that has problems with our bigger crafting display, so it is probably not something we generally need to guard against. We will still need to somehow fix it for Nucleon:
- We can open an issue, tho that is unlikely to ever get fixed (/dank/null's author left modding)
- We can try to get it fixed in the /dank/null RCE fork
- We can just fix it for Nucleon by using something like Bansoukou
- If all content in the MAD's inventory would also fit in a 3x3 inventory, pass a special subclass of
InventoryCraftingtoRecipe#matchesthat pretends like it is only a 3x3 grid and translates any calls to it into the original inventory matrix. Could also use really simple logic like:(last non-empty index) - (first non-empty index) <= 9(warning: spend no time thinking about</<=, probably off-by-one), and if that is true copy this slice into a newInventoryCrafting. - Start using
getCraftingResultfor the preview as well, that may solve the /dank/null specific case, although I am not sure.
