1
0
mirror of https://github.com/minetest/minetest_game.git synced 2024-12-22 23:10:17 +01:00

Use improved inventory callbacks

This commit is contained in:
Perttu Ahola 2012-07-25 15:14:36 +03:00
parent e550a0e26f
commit 6de625c67f

View File

@ -1184,7 +1184,7 @@ minetest.register_node("default:chest", {
minetest.log("action", player:get_player_name().. minetest.log("action", player:get_player_name()..
" moves stuff to chest at "..minetest.pos_to_string(pos)) " moves stuff to chest at "..minetest.pos_to_string(pos))
end, end,
on_metadata_inventory_take = function(pos, listname, index, count, player) on_metadata_inventory_take = function(pos, listname, index, stack, player)
minetest.log("action", player:get_player_name().. minetest.log("action", player:get_player_name()..
" takes stuff from chest at "..minetest.pos_to_string(pos)) " takes stuff from chest at "..minetest.pos_to_string(pos))
end, end,
@ -1249,7 +1249,7 @@ minetest.register_node("default:chest_locked", {
end end
return stack:get_count() return stack:get_count()
end, end,
allow_metadata_inventory_take = function(pos, listname, index, count, player) allow_metadata_inventory_take = function(pos, listname, index, stack, player)
local meta = minetest.env:get_meta(pos) local meta = minetest.env:get_meta(pos)
if not has_locked_chest_privilege(meta, player) then if not has_locked_chest_privilege(meta, player) then
minetest.log("action", player:get_player_name().. minetest.log("action", player:get_player_name()..
@ -1258,7 +1258,7 @@ minetest.register_node("default:chest_locked", {
minetest.pos_to_string(pos)) minetest.pos_to_string(pos))
return 0 return 0
end end
return count return stack:get_count()
end, end,
on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player) on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
minetest.log("action", player:get_player_name().. minetest.log("action", player:get_player_name()..
@ -1268,7 +1268,7 @@ minetest.register_node("default:chest_locked", {
minetest.log("action", player:get_player_name().. minetest.log("action", player:get_player_name()..
" moves stuff to locked chest at "..minetest.pos_to_string(pos)) " moves stuff to locked chest at "..minetest.pos_to_string(pos))
end, end,
on_metadata_inventory_take = function(pos, listname, index, count, player) on_metadata_inventory_take = function(pos, listname, index, stack, player)
minetest.log("action", player:get_player_name().. minetest.log("action", player:get_player_name()..
" takes stuff from locked chest at "..minetest.pos_to_string(pos)) " takes stuff from locked chest at "..minetest.pos_to_string(pos))
end, end,