Add [jumpdrive] support (#11)

Co-authored-by: BuckarooBanzay <BuckarooBanzay@users.noreply.github.com>
Co-authored-by: Luke aka SwissalpS <Luke@SwissalpS.ws>
Co-authored-by: Luke aka SwissalpS <161979+SwissalpS@users.noreply.github.com>
This commit is contained in:
Buckaroo Banzai 2024-12-31 19:24:37 +01:00 committed by GitHub
parent a869db3973
commit accb0350a0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 44 additions and 0 deletions

View File

@ -1,4 +1,5 @@
unused_args = false
--std = "luanti+max"
globals = {
"wrench",
@ -15,6 +16,7 @@ read_globals = {
"christmas",
"digilines",
"drawers",
"jumpdrive",
"mesecon",
"pipeworks",
"signs_lib",

View File

@ -38,6 +38,7 @@ local mods = {
"digistuff",
"digtron",
"drawers",
"jumpdrive",
"easyvend",
"mesecons_commandblock",
"mesecons_detector",

View File

@ -17,6 +17,7 @@ optional_depends = """
digiscreen,
digistuff,
drawers,
jumpdrive,
easyvend,
mesecons_commandblock,
mesecons_detector,

40
nodes/jumpdrive.lua Normal file
View File

@ -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
}
})