diff --git a/.luacheckrc b/.luacheckrc index 3552356..285a958 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -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", diff --git a/init.lua b/init.lua index bbaac33..18654b1 100644 --- a/init.lua +++ b/init.lua @@ -38,6 +38,7 @@ local mods = { "digistuff", "digtron", "drawers", + "jumpdrive", "easyvend", "mesecons_commandblock", "mesecons_detector", diff --git a/mod.conf b/mod.conf index 14a938d..d854bb2 100644 --- a/mod.conf +++ b/mod.conf @@ -17,6 +17,7 @@ optional_depends = """ digiscreen, digistuff, drawers, + jumpdrive, easyvend, mesecons_commandblock, mesecons_detector, diff --git a/nodes/jumpdrive.lua b/nodes/jumpdrive.lua new file mode 100644 index 0000000..c649bb5 --- /dev/null +++ b/nodes/jumpdrive.lua @@ -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 + } +})