minetest / minetest_game

Minetest Game - A lightweight and well-maintained base for modding [https://github.com/minetest/minetest/]
http://minetest.net/
Other
1.41k stars 567 forks source link

Crafting guide does not show recipes that use an alias as output #3117

Open monk-afk opened 1 month ago

monk-afk commented 1 month ago

Recipes registered to the alias

https://github.com/mt-mods/homedecor_modpack/blob/fa3f7f816b18f9aab2df47d05d12d24964817a5e/homedecor_lighting/init.lua#L1886

, its probably something to do with the crafts being registered to the alias that sfinv cant handle https://github.com/mt-mods/homedecor_modpack/blob/fa3f7f816b18f9aab2df47d05d12d24964817a5e/homedecor_lighting/init.lua#L1658-L1673

https://github.com/mt-mods/homedecor_modpack/issues/41#issuecomment-2119018470

appgurueu commented 1 month ago

This does smell like a bug, but from your description, it's hard to discern what precisely you mean.

It seems homedecor registers aliases and craft recipes using these aliases.

What's wrong? Do these show up incorrectly in the crafting guide? Does crafting not work? Do engine API functions not work?

wsor4035 commented 1 month ago

to hopefully help clarify of what i believe to be the issue: take an actual node def registration of modname:nodename, then creating an alias for it of modname:someothernodename. then register crafts to modname:someothernodename. they wont show up in sfinv, but will in unified inventory since it handles aliases

monk-afk commented 1 month ago

if it helps, this function will return nil for those nodes registered which has aliases for recipes

https://github.com/minetest/minetest_game/blob/1ce48351ea7b1586710c1e60e863e94ed06e2721/mods/mtg_craftguide/init.lua#L148

However, the recipes do exist and the items can be crafted with the intended recipes, yet the recipes are not shown in the crafting guide.

Screenshots

monk-afk commented 1 month ago

https://github.com/mt-mods/homedecor_modpack/issues/41#issuecomment-2120985434

monk-afk commented 1 month ago

Closing ticket since registration works if the alias is registered before the craft. This also applies to the ordering of available craft outputs: the last registered craft output is shown first, while the first registered craft output is shown last. I suppose this is an example of stacking.

wsor4035 commented 1 month ago

this shouldnt be closed as the issue isnt fixed (unified inventory handles this)