summaryrefslogtreecommitdiff
path: root/compat.lua
diff options
context:
space:
mode:
authorest31 <MTest31@outlook.com>2015-02-11 19:37:19 +0100
committerest31 <MTest31@outlook.com>2015-02-11 19:37:19 +0100
commitc505088fbb1bcdcd6d28fd89fcd935ee1b526619 (patch)
treee125eb946157f5503e1f0d93fb8b874311a7a122 /compat.lua
parent9af43b9f6f518e9a9552de2549e56b342b954b0a (diff)
downloadpipeworks-c505088fbb1bcdcd6d28fd89fcd935ee1b526619.tar
pipeworks-c505088fbb1bcdcd6d28fd89fcd935ee1b526619.tar.gz
pipeworks-c505088fbb1bcdcd6d28fd89fcd935ee1b526619.tar.bz2
pipeworks-c505088fbb1bcdcd6d28fd89fcd935ee1b526619.tar.xz
pipeworks-c505088fbb1bcdcd6d28fd89fcd935ee1b526619.zip
Set the owner for locked chests on placing
Diffstat (limited to 'compat.lua')
-rw-r--r--compat.lua8
1 files changed, 7 insertions, 1 deletions
diff --git a/compat.lua b/compat.lua
index c64becf..c89e492 100644
--- a/compat.lua
+++ b/compat.lua
@@ -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
})