1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-22 17:18:39 +00:00

Improve inventory callbacks a bit

This commit is contained in:
Perttu Ahola 2012-07-25 14:35:59 +03:00
parent 0a18dda158
commit 983e45ae92
6 changed files with 65 additions and 46 deletions

View file

@ -534,7 +534,7 @@ local inv = minetest.create_detached_inventory("test_inventory", {
experimental.print_to_everything("allow put asked")
return 1 -- Allow only 1
end,
allow_take = function(inv, listname, index, count, player)
allow_take = function(inv, listname, index, stack, player)
experimental.print_to_everything("allow take asked")
return 4 -- Allow 4 at max
end,
@ -544,7 +544,7 @@ local inv = minetest.create_detached_inventory("test_inventory", {
on_put = function(inv, listname, index, stack, player)
experimental.print_to_everything(player:get_player_name().." put items")
end,
on_take = function(inv, listname, index, count, player)
on_take = function(inv, listname, index, stack, player)
experimental.print_to_everything(player:get_player_name().." took items")
end,
})