summaryrefslogtreecommitdiff
path: root/lua/visual.lua
diff options
context:
space:
mode:
authorLNJ <git@lnj.li>2017-06-03 17:40:29 +0200
committerLNJ <git@lnj.li>2017-06-03 17:40:29 +0200
commiteb8d2dfd3850260242c41c9942fe58f9d6bf6b21 (patch)
treeaea4a42a8b1a26d43549503861ed3578d2a57bf0 /lua/visual.lua
parente6dfba0e2f0904f7cd20622be2399151ae34c008 (diff)
Set formspec on every load to support old drawers
Before this you had to dig and rebuild your drawers to get the drawer formspecs and the ability to add upgrades.
Diffstat (limited to 'lua/visual.lua')
-rwxr-xr-xlua/visual.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/lua/visual.lua b/lua/visual.lua
index 3287f65..db0f570 100755
--- a/lua/visual.lua
+++ b/lua/visual.lua
@@ -363,6 +363,13 @@ core.register_lbm({
nodenames = {"group:drawer"},
run_at_every_load = true,
action = function(pos, node)
+ local meta = core.get_meta(pos)
+ -- create drawer upgrade inventory
+ meta:get_inventory():set_size("upgrades", 5)
+ -- set the formspec
+ meta:set_string("formspec", drawers.drawer_formspec)
+
+ -- count the drawer visuals
local drawerType = core.registered_nodes[node.name].groups.drawer
local foundVisuals = 0
local objs = core.get_objects_inside_radius(pos, 0.537)