mirror of
https://github.com/luanti-org/minetest_game.git
synced 2025-06-06 22:04:25 -04:00
Merge 749dca04ef
into 3ecafbcfb4
This commit is contained in:
commit
61459fa78e
1 changed files with 23 additions and 6 deletions
|
@ -1463,16 +1463,33 @@ minetest.register_node("default:chest", {
|
|||
minetest.log("action", player:get_player_name() ..
|
||||
" moves stuff in chest at " .. minetest.pos_to_string(pos))
|
||||
end,
|
||||
on_metadata_inventory_put = function(pos, listname, index, stack, player)
|
||||
on_metadata_inventory_put = function(pos, listname, index, stack, player)
|
||||
minetest.log("action", player:get_player_name() ..
|
||||
" moves " .. stack:get_name() ..
|
||||
" to chest at " .. minetest.pos_to_string(pos))
|
||||
end,
|
||||
on_metadata_inventory_take = function(pos, listname, index, stack, player)
|
||||
on_metadata_inventory_take = function(pos, listname, index, stack, player)
|
||||
minetest.log("action", player:get_player_name() ..
|
||||
" takes " .. stack:get_name() ..
|
||||
" from chest at " .. minetest.pos_to_string(pos))
|
||||
end,
|
||||
on_blast = function(pos)
|
||||
minetest.after(0.1, function()
|
||||
local inv = minetest.get_meta(pos):get_inventory()
|
||||
for i = 1, inv:get_size("main") do
|
||||
local m_stack = inv:get_stack("main", i)
|
||||
local obj = minetest.add_item(pos, m_stack)
|
||||
if obj then
|
||||
obj:setvelocity({
|
||||
x = math.random(-10, 10) / 9,
|
||||
y = 3,
|
||||
z = math.random(-10, 10) / 9
|
||||
})
|
||||
end
|
||||
end
|
||||
minetest.remove_node(pos)
|
||||
end)
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_node("default:chest_locked", {
|
||||
|
@ -1511,26 +1528,26 @@ minetest.register_node("default:chest_locked", {
|
|||
end
|
||||
return count
|
||||
end,
|
||||
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
|
||||
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
|
||||
local meta = minetest.get_meta(pos)
|
||||
if not has_locked_chest_privilege(meta, player) then
|
||||
return 0
|
||||
end
|
||||
return stack:get_count()
|
||||
end,
|
||||
allow_metadata_inventory_take = function(pos, listname, index, stack, player)
|
||||
allow_metadata_inventory_take = function(pos, listname, index, stack, player)
|
||||
local meta = minetest.get_meta(pos)
|
||||
if not has_locked_chest_privilege(meta, player) then
|
||||
return 0
|
||||
end
|
||||
return stack:get_count()
|
||||
end,
|
||||
on_metadata_inventory_put = function(pos, listname, index, stack, player)
|
||||
on_metadata_inventory_put = function(pos, listname, index, stack, player)
|
||||
minetest.log("action", player:get_player_name() ..
|
||||
" moves " .. stack:get_name() ..
|
||||
" to locked chest at " .. minetest.pos_to_string(pos))
|
||||
end,
|
||||
on_metadata_inventory_take = function(pos, listname, index, stack, player)
|
||||
on_metadata_inventory_take = function(pos, listname, index, stack, player)
|
||||
minetest.log("action", player:get_player_name() ..
|
||||
" takes " .. stack:get_name() ..
|
||||
" from locked chest at " .. minetest.pos_to_string(pos))
|
||||
|
|
Loading…
Add table
Reference in a new issue