Skip to content

Commit

Permalink
Add [jumpdrive] support (#11)
Browse files Browse the repository at this point in the history
Co-authored-by: BuckarooBanzay <[email protected]>
Co-authored-by: Luke aka SwissalpS <[email protected]>
Co-authored-by: Luke aka SwissalpS <[email protected]>
  • Loading branch information
4 people authored Dec 31, 2024
1 parent a869db3 commit accb035
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .luacheckrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
unused_args = false
--std = "luanti+max"

globals = {
"wrench",
Expand All @@ -15,6 +16,7 @@ read_globals = {
"christmas",
"digilines",
"drawers",
"jumpdrive",
"mesecon",
"pipeworks",
"signs_lib",
Expand Down
1 change: 1 addition & 0 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ local mods = {
"digistuff",
"digtron",
"drawers",
"jumpdrive",
"easyvend",
"mesecons_commandblock",
"mesecons_detector",
Expand Down
1 change: 1 addition & 0 deletions mod.conf
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ optional_depends = """
digiscreen,
digistuff,
drawers,
jumpdrive,
easyvend,
mesecons_commandblock,
mesecons_detector,
Expand Down
40 changes: 40 additions & 0 deletions nodes/jumpdrive.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@

-- Register wrench support for the jumpdrive mod

wrench.register_node("jumpdrive:engine", {
lists = {"main", "upgrade"},
metas = {
x = wrench.META_TYPE_INT,
y = wrench.META_TYPE_INT,
z = wrench.META_TYPE_INT,
radius = wrench.META_TYPE_INT,
powerstorage = wrench.META_TYPE_INT,
max_powerstorage = wrench.META_TYPE_INT,
power_requirement = wrench.META_TYPE_IGNORE,
owner = wrench.META_TYPE_STRING,
channel = wrench.META_TYPE_STRING,
infotext = wrench.META_TYPE_STRING,
formspec = wrench.META_TYPE_IGNORE, -- legacy field
HV_EU_input = wrench.META_TYPE_IGNORE,
HV_EU_demand = wrench.META_TYPE_IGNORE
},
after_place = function(pos)
jumpdrive.update_formspec(core.get_meta(pos), pos)
end,
})

wrench.register_node("jumpdrive:fleet_controller", {
lists = {"main"},
metas = {
x = wrench.META_TYPE_INT,
y = wrench.META_TYPE_INT,
z = wrench.META_TYPE_INT,
owner = wrench.META_TYPE_STRING,
channel = wrench.META_TYPE_STRING,
infotext = wrench.META_TYPE_STRING,
formspec = wrench.META_TYPE_STRING,
active = wrench.META_TYPE_INT,
jump_index = wrench.META_TYPE_INT,
jump_list = wrench.META_TYPE_STRING
}
})

0 comments on commit accb035

Please sign in to comment.