diff options
author | est31 <MTest31@outlook.com> | 2015-02-11 19:37:19 +0100 |
---|---|---|
committer | est31 <MTest31@outlook.com> | 2015-02-11 19:37:19 +0100 |
commit | c505088fbb1bcdcd6d28fd89fcd935ee1b526619 (patch) | |
tree | e125eb946157f5503e1f0d93fb8b874311a7a122 /compat.lua | |
parent | 9af43b9f6f518e9a9552de2549e56b342b954b0a (diff) |
Set the owner for locked chests on placing
Diffstat (limited to 'compat.lua')
-rw-r--r-- | compat.lua | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -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 }) |