From cc6fb55ba899df2b2b6ed9369f1c8469f15a2374 Mon Sep 17 00:00:00 2001 From: BuckarooBanzay Date: Thu, 10 Aug 2023 06:35:16 +0200 Subject: [PATCH 1/7] add `jumpdrive:engine` support --- init.lua | 1 + mod.conf | 1 + nodes/jumpdrive.lua | 20 ++++++++++++++++++++ 3 files changed, 22 insertions(+) create mode 100644 nodes/jumpdrive.lua diff --git a/init.lua b/init.lua index 1357bf2..d9ea1c6 100644 --- a/init.lua +++ b/init.lua @@ -34,6 +34,7 @@ local mods = { "digistuff", "digtron", "drawers", + "jumpdrive", "mesecons_commandblock", "mesecons_detector", "mesecons_luacontroller", diff --git a/mod.conf b/mod.conf index c84c353..8ee6988 100644 --- a/mod.conf +++ b/mod.conf @@ -13,6 +13,7 @@ optional_depends = """ digiscreen, digistuff, drawers, + jumpdrive, mesecons_commandblock, mesecons_detector, mesecons_luacontroller, diff --git a/nodes/jumpdrive.lua b/nodes/jumpdrive.lua new file mode 100644 index 0000000..99fc65e --- /dev/null +++ b/nodes/jumpdrive.lua @@ -0,0 +1,20 @@ + +-- 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, + 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 + } +}) From 795e54a8c793ff0e673da2e870ba398411152d49 Mon Sep 17 00:00:00 2001 From: BuckarooBanzay Date: Thu, 17 Aug 2023 09:07:33 +0200 Subject: [PATCH 2/7] add `jumpdrive:fleet_controller` --- nodes/jumpdrive.lua | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/nodes/jumpdrive.lua b/nodes/jumpdrive.lua index 99fc65e..163da38 100644 --- a/nodes/jumpdrive.lua +++ b/nodes/jumpdrive.lua @@ -18,3 +18,19 @@ wrench.register_node("jumpdrive:engine", { HV_EU_demand = wrench.META_TYPE_IGNORE } }) + +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 + } +}) From d815bed123221bfe9ddb4bd79a0048b39780dc0f Mon Sep 17 00:00:00 2001 From: Luke aka SwissalpS Date: Tue, 24 Dec 2024 00:33:19 +0100 Subject: [PATCH 3/7] add missing meta-field: power_requirement --- nodes/jumpdrive.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/nodes/jumpdrive.lua b/nodes/jumpdrive.lua index 163da38..6daabc8 100644 --- a/nodes/jumpdrive.lua +++ b/nodes/jumpdrive.lua @@ -10,6 +10,7 @@ wrench.register_node("jumpdrive:engine", { 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, From d3d64aebc135fc86cdab172c7b541fb94fbc1a60 Mon Sep 17 00:00:00 2001 From: Luke aka SwissalpS Date: Tue, 24 Dec 2024 01:13:52 +0100 Subject: [PATCH 4/7] jumpdrive: update formspec after place --- .luacheckrc | 2 ++ nodes/jumpdrive.lua | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.luacheckrc b/.luacheckrc index 3178a9b..a274471 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -5,12 +5,14 @@ globals = { } read_globals = { + "core", "table.copy", "table.indexof", "minetest", "ItemStack", "digilines", "drawers", + "jumpdrive", "mesecon", "pipeworks", "signs_lib", diff --git a/nodes/jumpdrive.lua b/nodes/jumpdrive.lua index 6daabc8..cf47fb1 100644 --- a/nodes/jumpdrive.lua +++ b/nodes/jumpdrive.lua @@ -17,7 +17,10 @@ wrench.register_node("jumpdrive:engine", { 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", { From 744320ab4f31d0ea631ac455432b1ec4eacb3308 Mon Sep 17 00:00:00 2001 From: Luke aka SwissalpS Date: Tue, 24 Dec 2024 09:56:39 +0100 Subject: [PATCH 5/7] whitespace: switch to tabs indentation like the main mod code is using --- nodes/jumpdrive.lua | 64 ++++++++++++++++++++++----------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/nodes/jumpdrive.lua b/nodes/jumpdrive.lua index cf47fb1..c649bb5 100644 --- a/nodes/jumpdrive.lua +++ b/nodes/jumpdrive.lua @@ -2,39 +2,39 @@ -- 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, + 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 - } + 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 + } }) From 08f79d70c5093036cfd798a8f6eb2b494be89de8 Mon Sep 17 00:00:00 2001 From: Luke aka SwissalpS Date: Wed, 25 Dec 2024 09:35:49 +0100 Subject: [PATCH 6/7] use launti+max std --- .luacheckrc | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.luacheckrc b/.luacheckrc index a274471..bfef40e 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -1,15 +1,11 @@ unused_args = false +std = "luanti+max" globals = { "wrench", } read_globals = { - "core", - "table.copy", - "table.indexof", - "minetest", - "ItemStack", "digilines", "drawers", "jumpdrive", From 2f6290d3814392be93a66f5d71a201435a4d2e3a Mon Sep 17 00:00:00 2001 From: Luke aka SwissalpS Date: Wed, 25 Dec 2024 15:39:13 +0100 Subject: [PATCH 7/7] revert .luacheckrc until github images are updated --- .luacheckrc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.luacheckrc b/.luacheckrc index bfef40e..f9718a7 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -1,11 +1,16 @@ unused_args = false -std = "luanti+max" +--std = "luanti+max" globals = { "wrench", } read_globals = { + "core", + "table.copy", + "table.indexof", + "minetest", + "ItemStack", "digilines", "drawers", "jumpdrive",