Closed Wuzzy2 closed 4 years ago
That's only called when a player directory changes their inventory, not when they dig a node or when a mod places something in their inventory.
Digging a node is not a problem as it always predates opening the craftguide (which by itself update the list*). But indeed polling covers more scenarios currently, despite the temptation to use this callback.
*not since https://github.com/minetest-mods/craftguide/commit/07bc14e516f0b17cac00b5526a37419e145932a3
Wait, what? So when you get an item from a dug node, that does not count as inventory change? And a mod changing the inventory does also not count? How stupid is that?! Are you sure?
Are you sure?
Yes. Moreover when you put e.g. a stack of wood inside the craft grid, you call get_inv_items
inside register_on_player_inventory_action
, it isn't aware that a stack of sticks is in the craftpreview
list. You have to move the stack of wood within the grid so it can get what's inside the craftpreview
list. This is kind of broken.
In 5.0.0 it is now possible to detect when a player inventory changed:
Currently, this mod updates the progressive mode discovered items by polling. I request this behaviour to be optimized accordingly.