Skip to content

Commit

Permalink
Add [powerbanks] support (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
SwissalpS authored Dec 29, 2024
1 parent 90d1881 commit 88e4d9b
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ local mods = {
"mobs",
"more_chests",
"pipeworks",
"powerbanks",
"protector",
"signs_lib",
"technic",
Expand Down
1 change: 1 addition & 0 deletions mod.conf
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ optional_depends = """
mobs,
more_chests,
pipeworks,
powerbanks,
protector,
signs_lib,
technic,
Expand Down
23 changes: 23 additions & 0 deletions nodes/powerbanks.lua
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 88e4d9b

Please sign in to comment.