diff --git a/init.lua b/init.lua index 6343603..5d6a01b 100644 --- a/init.lua +++ b/init.lua @@ -44,6 +44,7 @@ local mods = { "mobs", "more_chests", "pipeworks", + "powerbanks", "protector", "signs_lib", "technic", diff --git a/mod.conf b/mod.conf index 5aee59b..9057ba0 100644 --- a/mod.conf +++ b/mod.conf @@ -23,6 +23,7 @@ optional_depends = """ mobs, more_chests, pipeworks, + powerbanks, protector, signs_lib, technic, diff --git a/nodes/powerbanks.lua b/nodes/powerbanks.lua new file mode 100644 index 0000000..7c404b9 --- /dev/null +++ b/nodes/powerbanks.lua @@ -0,0 +1,23 @@ + +-- Register wrench support for the powerbanks mod + +for i = 1, 3 do + wrench.register_node("powerbanks:powerbank_mk" .. i .. "_node", { + lists = { "main" }, + metas = { + charge = wrench.META_TYPE_INT, + formspec = wrench.META_TYPE_IGNORE, + infotext = wrench.META_TYPE_IGNORE, + owner = wrench.META_TYPE_STRING, + }, + timer = true, + after_place = function(pos) + local timer = core.get_node_timer(pos) + if not timer:is_started() then + -- Just to re-create infotext and formspec. + timer:start(0) + end + end, + }) +end +