mirror of
https://github.com/mt-mods/homedecor_modpack.git
synced 2025-01-08 23:50:19 +01:00
add mesecons support to doors
This commit is contained in:
parent
e767b08011
commit
c28df63aae
@ -114,6 +114,28 @@ local door_list = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
local old_doors = {}
|
local old_doors = {}
|
||||||
|
local mesecons
|
||||||
|
|
||||||
|
-- This part blatantly copied from Mesecons, and modified :-)
|
||||||
|
if minetest.get_modpath("mesecons") then
|
||||||
|
mesecons = {
|
||||||
|
effector = {
|
||||||
|
action_on = function(pos, node)
|
||||||
|
local door = doors.get(pos)
|
||||||
|
if door then
|
||||||
|
door:open()
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
action_off = function(pos, node)
|
||||||
|
local door = doors.get(pos)
|
||||||
|
if door then
|
||||||
|
door:close()
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
rules = mesecon.rules.pplate
|
||||||
|
}
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
for _, door in ipairs(door_list) do
|
for _, door in ipairs(door_list) do
|
||||||
doors.register(door.name, {
|
doors.register(door.name, {
|
||||||
@ -123,7 +145,8 @@ for _, door in ipairs(door_list) do
|
|||||||
groups = table.copy(door.groups),
|
groups = table.copy(door.groups),
|
||||||
sounds = door.sounds.main,
|
sounds = door.sounds.main,
|
||||||
sound_open = door.sounds.open,
|
sound_open = door.sounds.open,
|
||||||
sound_close = door.sounds.close
|
sound_close = door.sounds.close,
|
||||||
|
mesecons = mesecons
|
||||||
})
|
})
|
||||||
if door.alpha then
|
if door.alpha then
|
||||||
minetest.override_item("doors:"..door.name.."_a", {
|
minetest.override_item("doors:"..door.name.."_a", {
|
||||||
|
Loading…
Reference in New Issue
Block a user