summaryrefslogtreecommitdiff
path: root/nodes/node_battery_holder.lua
diff options
context:
space:
mode:
authorFaceDeer <derksenmobile@gmail.com>2017-10-21 22:29:18 -0600
committerFaceDeer <derksenmobile@gmail.com>2017-10-21 22:29:18 -0600
commit94ccab9c391f0a08e9382220112a9546a108d3fd (patch)
treef5dab01bbf6e1e277694f190cb48518600499a87 /nodes/node_battery_holder.lua
parente93ff0595617ebfb7b4498519538c38787a9aa16 (diff)
add automation option to item ejector
Diffstat (limited to 'nodes/node_battery_holder.lua')
-rw-r--r--nodes/node_battery_holder.lua8
1 files changed, 5 insertions, 3 deletions
diff --git a/nodes/node_battery_holder.lua b/nodes/node_battery_holder.lua
index 6bd4fc3..56e0cd8 100644
--- a/nodes/node_battery_holder.lua
+++ b/nodes/node_battery_holder.lua
@@ -6,8 +6,7 @@ local S, NS = dofile(MP.."/intllib.lua")
-- Battery storage. Controller node draws electrical power from here.
-- Note that batttery boxes are digtron group 7.
-local battery_holder_formspec =
- "size[8,9.3]" ..
+local battery_holder_formspec_string = "size[8,9.3]" ..
default.gui_bg ..
default.gui_bg_img ..
default.gui_slots ..
@@ -19,6 +18,9 @@ local battery_holder_formspec =
"listring[current_player;main]" ..
default.get_hotbar_bg(0,5.15)
+local battery_holder_formspec = function(pos, meta)
+ return battery_holder_formspec_string
+end
local holder_groups = {cracky = 3, oddly_breakable_by_hand = 3, digtron = 7, tubedevice = 1, tubedevice_receiver = 1}
if not minetest.get_modpath("technic") then
@@ -50,7 +52,7 @@ minetest.register_node("digtron:battery_holder", {
on_construct = function(pos)
local meta = minetest.get_meta(pos)
- meta:set_string("formspec", battery_holder_formspec)
+ meta:set_string("formspec", battery_holder_formspec(pos, meta))
local inv = meta:get_inventory()
inv:set_size("batteries", 8*4)
end,