From 83d55f241a4c68d5cefb92d851e403e23ae889ea Mon Sep 17 00:00:00 2001 From: Niklp Date: Tue, 22 Oct 2024 17:40:16 +0200 Subject: [PATCH] Remove obsolete mesecons integration (#37) --- .luacheckrc | 5 ----- my_castle_doors/locked.lua | 2 +- my_castle_doors/unlocked.lua | 2 +- my_cottage_doors/locked.lua | 2 +- my_cottage_doors/unlocked.lua | 2 +- my_default_doors/locked.lua | 2 +- my_default_doors/unlocked.lua | 2 +- my_door_wood/init.lua | 24 ------------------------ my_door_wood/mod.conf | 2 +- my_fancy_doors/locked.lua | 2 +- my_fancy_doors/unlocked.lua | 2 +- my_hidden_doors/init.lua | 4 ++-- my_misc_doors/locked.lua | 2 +- my_misc_doors/unlocked.lua | 2 +- my_old_doors/locked.lua | 2 +- my_old_doors/unlocked.lua | 2 +- 16 files changed, 15 insertions(+), 44 deletions(-) diff --git a/.luacheckrc b/.luacheckrc index eaec4b8..6854167 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -9,9 +9,4 @@ read_globals = { "screwdriver", "stairs", "stairsplus", - "mesecon", } - -globals = { - "mydoors" -} \ No newline at end of file diff --git a/my_castle_doors/locked.lua b/my_castle_doors/locked.lua index e89aadb..fb466b7 100644 --- a/my_castle_doors/locked.lua +++ b/my_castle_doors/locked.lua @@ -15,7 +15,7 @@ local cdoor_list = { --Number , Description , Inven Image , Image } local function add_door(desc, img) - mydoors.register_door("my_castle_doors:"..img.."_locked", { + doors.register_door("my_castle_doors:"..img.."_locked", { description = desc.." Locked", inventory_image = "mydoors_"..img.."_inv.png", groups = {choppy=2,cracky=2,door=1}, diff --git a/my_castle_doors/unlocked.lua b/my_castle_doors/unlocked.lua index e63550b..e3eade7 100644 --- a/my_castle_doors/unlocked.lua +++ b/my_castle_doors/unlocked.lua @@ -15,7 +15,7 @@ local cdoor_list = { --Number , Description , Inven Image , Image } local function add_door(desc, img) - mydoors.register_door("my_castle_doors:"..img, { + doors.register_door("my_castle_doors:"..img, { description = desc, inventory_image = "mydoors_"..img.."_inv.png", groups = {choppy=2,cracky=2,door=1}, diff --git a/my_cottage_doors/locked.lua b/my_cottage_doors/locked.lua index 1b6e7cb..b2d5f9e 100644 --- a/my_cottage_doors/locked.lua +++ b/my_cottage_doors/locked.lua @@ -4,7 +4,7 @@ local cdoor_list = { --Number , Description , Inven Image , Image } local function add_door(desc, img) - mydoors.register_door("my_cottage_doors:"..img.."_locked", { + doors.register_door("my_cottage_doors:"..img.."_locked", { description = desc.." Locked", inventory_image = "mycdoors_"..img.."_inv.png", groups = {choppy=2,cracky=2,door=1}, diff --git a/my_cottage_doors/unlocked.lua b/my_cottage_doors/unlocked.lua index a711533..41c0103 100644 --- a/my_cottage_doors/unlocked.lua +++ b/my_cottage_doors/unlocked.lua @@ -4,7 +4,7 @@ local cdoor_list = { --Number , Description , Inven Image , Image } local function add_door(desc, img) - mydoors.register_door("my_cottage_doors:"..img, { + doors.register_door("my_cottage_doors:"..img, { description = desc, inventory_image = "mycdoors_"..img.."_inv.png", groups = {choppy=2,cracky=2,door=1}, diff --git a/my_default_doors/locked.lua b/my_default_doors/locked.lua index f000262..e165454 100644 --- a/my_default_doors/locked.lua +++ b/my_default_doors/locked.lua @@ -7,7 +7,7 @@ local cdoor_list = { --Number , Description , Inven Image , Image } local function add_door(num, desc, img, itm) - mydoors.register_door("my_default_doors:door"..num.."_locked", { + doors.register_door("my_default_doors:door"..num.."_locked", { description = desc.." Locked", inventory_image = "mydoors_"..img.."_inv.png", groups = {choppy=2,cracky=2,door=1}, diff --git a/my_default_doors/unlocked.lua b/my_default_doors/unlocked.lua index 8243a9f..c7d2b0e 100644 --- a/my_default_doors/unlocked.lua +++ b/my_default_doors/unlocked.lua @@ -7,7 +7,7 @@ local cdoor_list = { --Number , Description , Inven Image , Image } local function add_door(num, desc, img, itm) - mydoors.register_door("my_default_doors:door"..num, { + doors.register_door("my_default_doors:door"..num, { description = desc, inventory_image = "mydoors_"..img.."_inv.png", groups = {choppy=2,cracky=2,door=1}, diff --git a/my_door_wood/init.lua b/my_door_wood/init.lua index a9cb835..22a5145 100644 --- a/my_door_wood/init.lua +++ b/my_door_wood/init.lua @@ -58,27 +58,3 @@ end for _,door in ipairs(door_wood) do add_door(unpack(door)) end - -mydoors = {} - -local mesecons = {effector = { - action_on = function(pos) - local door = doors.get(pos) - if door then - door:open() - end - end, - action_off = function(pos) - local door = doors.get(pos) - if door then - door:close() - end - end, - rules = minetest.global_exists("mesecon") and mesecon.rules.pplate or nil -}} - --- Helper function for mesecons support -function mydoors.register_door(name, def) - def.mesecons = mesecons - doors.register(name, def) -end diff --git a/my_door_wood/mod.conf b/my_door_wood/mod.conf index 47d6a0e..c225b5f 100644 --- a/my_door_wood/mod.conf +++ b/my_door_wood/mod.conf @@ -1,4 +1,4 @@ name = my_door_wood description = Wood that is used to make doors. depends = default -optional_depends = stairs, moreblocks, mesecons \ No newline at end of file +optional_depends = stairs, moreblocks \ No newline at end of file diff --git a/my_fancy_doors/locked.lua b/my_fancy_doors/locked.lua index c6bc0de..01c37e7 100644 --- a/my_fancy_doors/locked.lua +++ b/my_fancy_doors/locked.lua @@ -10,7 +10,7 @@ local fdoor_list = { --Number , Description , Inven Image , Image } local function add_door(desc, img) - mydoors.register_door("my_fancy_doors:"..img.."_locked", { + doors.register_door("my_fancy_doors:"..img.."_locked", { description = desc.." Locked", inventory_image = "myfdoors_"..img.."_inv.png", groups = {choppy=2,cracky=2,door=1}, diff --git a/my_fancy_doors/unlocked.lua b/my_fancy_doors/unlocked.lua index 9750b1b..6ffc7df 100644 --- a/my_fancy_doors/unlocked.lua +++ b/my_fancy_doors/unlocked.lua @@ -10,7 +10,7 @@ local fdoor_list = { --Number , Description , Inven Image , Image } local function add_door(desc, img) - mydoors.register_door("my_fancy_doors:"..img, { + doors.register_door("my_fancy_doors:"..img, { description = desc, inventory_image = "myfdoors_"..img.."_inv.png", groups = {choppy=2,cracky=2,door=1}, diff --git a/my_hidden_doors/init.lua b/my_hidden_doors/init.lua index 1a8795b..26aea2f 100644 --- a/my_hidden_doors/init.lua +++ b/my_hidden_doors/init.lua @@ -12,7 +12,7 @@ local hdoor_list = { --Number , Description , default image local function add_door(img, desc) -- Cannot add locked doors because the tooltip defies the purpose of being a hidden door - mydoors.register_door("my_hidden_doors:hidden_door"..img, { + doors.register_door("my_hidden_doors:hidden_door"..img, { description = desc, inventory_image = "mydoors_"..img.."_inv.png", groups = {choppy=2,cracky=2,door=1}, @@ -26,7 +26,7 @@ for _,hdoor in ipairs(hdoor_list) do add_door(unpack(hdoor)) end -mydoors.register_door("my_hidden_doors:hidden_door_grey", { +doors.register_door("my_hidden_doors:hidden_door_grey", { description = "Grey Door", inventory_image = "mydoors_grey_inv.png", groups = {choppy=2,cracky=2,door=1}, diff --git a/my_misc_doors/locked.lua b/my_misc_doors/locked.lua index 3bc3b18..336a9eb 100644 --- a/my_misc_doors/locked.lua +++ b/my_misc_doors/locked.lua @@ -7,7 +7,7 @@ local mdoor_list = { --Number , Description , Inven Image , Image } local function add_door(desc, img) - mydoors.register_door("my_misc_doors:"..img.."_locked", { + doors.register_door("my_misc_doors:"..img.."_locked", { description = desc.." Locked", inventory_image = "mymdoors_"..img.."_inv.png", groups = {choppy=2,cracky=2,door=1}, diff --git a/my_misc_doors/unlocked.lua b/my_misc_doors/unlocked.lua index 4d8597b..3aec6bf 100644 --- a/my_misc_doors/unlocked.lua +++ b/my_misc_doors/unlocked.lua @@ -7,7 +7,7 @@ local mdoor_list = { --Number , Description , Inven Image , Image } local function add_door(desc, img) - mydoors.register_door("my_misc_doors:"..img, { + doors.register_door("my_misc_doors:"..img, { description = desc, inventory_image = "mymdoors_"..img.."_inv.png", groups = {choppy=2,cracky=2,door=1}, diff --git a/my_old_doors/locked.lua b/my_old_doors/locked.lua index 67d7f46..9e9c54f 100644 --- a/my_old_doors/locked.lua +++ b/my_old_doors/locked.lua @@ -6,7 +6,7 @@ local cdoor_list = { --Number , Description , Inven Image , Image } local function add_door(num, desc, img) - mydoors.register_door("my_old_doors:door"..num.."_locked", { + doors.register_door("my_old_doors:door"..num.."_locked", { description = desc.." Locked", inventory_image = "mydoors_"..img.."_inv.png", groups = {choppy=2,cracky=2,door=1}, diff --git a/my_old_doors/unlocked.lua b/my_old_doors/unlocked.lua index fe1e0f9..e323f3c 100644 --- a/my_old_doors/unlocked.lua +++ b/my_old_doors/unlocked.lua @@ -6,7 +6,7 @@ local cdoor_list = { --Number , Description , Inven Image , Image } local function add_door(num, desc, img) - mydoors.register_door("my_old_doors:door"..num, { + doors.register_door("my_old_doors:door"..num, { description = desc, inventory_image = "mydoors_"..img.."_inv.png", groups = {choppy=2,cracky=2,door=1},