Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support doors and trapdoors from mods #683

Merged
merged 2 commits into from
Oct 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 12 additions & 15 deletions mesecons_doors/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,6 @@ local function meseconify_door(name)
end
end

local doors_list = {
"doors:door_wood",
"doors:door_steel",
"doors:door_glass",
"doors:door_obsidian_glass",
"xpanes:door_steel_bar",
}
for i=1,#doors_list do meseconify_door(doors_list[i]) end

-- Trapdoor
local function trapdoor_switch(name)
return function(pos, node)
Expand Down Expand Up @@ -131,9 +122,15 @@ local function meseconify_trapdoor(name)
end
end

local trapdoors_list = {
"doors:trapdoor",
"doors:trapdoor_steel",
"xpanes:trapdoor_steel_bar"
}
for i=1,#trapdoors_list do meseconify_trapdoor(trapdoors_list[i]) end
minetest.register_on_mods_loaded(function()
for k,_ in pairs(doors.registered_doors) do
if k:find("_a$") then
meseconify_door(k:sub(1,-3))
end
end
for k,_ in pairs(doors.registered_trapdoors) do
if not k:find("_open$") then
meseconify_trapdoor(k)
end
end
end)