mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-22 18:41:09 +01:00
Fix double chest placement destroy contents
This commit is contained in:
parent
355261ee51
commit
3bb0a9003a
1 changed files with 2 additions and 8 deletions
|
@ -52,17 +52,11 @@ minetest.register_node("mcl_chests:"..basename, {
|
|||
if minetest.get_node(get_chest_neighborpos(pos, param2, "right")).name == "mcl_chests:"..basename then
|
||||
minetest.swap_node(pos, {name="mcl_chests:"..basename.."_right",param2=param2})
|
||||
local p = get_chest_neighborpos(pos, param2, "right")
|
||||
minetest.set_node(p, { name = "mcl_chests:"..basename.."_left", param2 = param2 })
|
||||
meta = minetest.get_meta(p)
|
||||
inv = meta:get_inventory()
|
||||
inv:set_size("main", 9*3)
|
||||
minetest.swap_node(p, { name = "mcl_chests:"..basename.."_left", param2 = param2 })
|
||||
elseif minetest.get_node(get_chest_neighborpos(pos, param2, "left")).name == "mcl_chests:"..basename then
|
||||
minetest.swap_node(pos, {name="mcl_chests:"..basename.."_left",param2=param2})
|
||||
local p = get_chest_neighborpos(pos, param2, "left")
|
||||
minetest.set_node(p, { name = "mcl_chests:"..basename.."_right", param2 = param2 })
|
||||
meta = minetest.get_meta(p)
|
||||
inv = meta:get_inventory()
|
||||
inv:set_size("main", 9*3)
|
||||
minetest.swap_node(p, { name = "mcl_chests:"..basename.."_right", param2 = param2 })
|
||||
end
|
||||
end,
|
||||
after_dig_node = function(pos, oldnode, oldmetadata, digger)
|
||||
|
|
Loading…
Reference in a new issue