1
0
mirror of https://github.com/mt-mods/pipeworks.git synced 2024-12-25 02:10:23 +01:00

Set the owner for locked chests on placing

This commit is contained in:
est31 2015-02-11 19:37:19 +01:00
parent 9af43b9f6f
commit c505088fbb

View File

@ -133,7 +133,13 @@ minetest.override_item("default:chest_locked", {
end,
connect_sides = {left = 1, right = 1, back = 1, front = 1, bottom = 1, top = 1}
},
after_place_node = pipeworks.after_place,
after_place_node = function (pos, placer)
local meta = minetest.get_meta(pos)
meta:set_string("owner", placer:get_player_name() or "")
meta:set_string("infotext", "Locked Chest (owned by "..
meta:get_string("owner")..")")
pipeworks.after_place(pos)
end,
after_dig_node = pipeworks.after_dig
})