make doors and gates respond to vertical mesecon two nodes below

using pressure plate rules
This commit is contained in:
Vanessa Dannenberg 2018-08-28 23:07:37 -04:00
parent a8729575ab
commit 55fea4f6ca
2 changed files with 6 additions and 0 deletions

View File

@ -13,3 +13,4 @@ beds?
flowers? flowers?
3d_armor? 3d_armor?
skinsdb? skinsdb?
mesecons?

View File

@ -4,6 +4,8 @@ local S = homedecor_i18n.gettext
local function N_(x) return x end local function N_(x) return x end
local m_rules = mesecon and mesecon.rules and mesecon.rules.pplate
-- doors -- doors
local function isSolid(pos, adjust) local function isSolid(pos, adjust)
@ -264,6 +266,7 @@ for i, side in ipairs(sides) do
drop = "homedecor:door_"..doorname.."_left", drop = "homedecor:door_"..doorname.."_left",
mesecons = { mesecons = {
effector = { effector = {
rules = m_rules,
action_on = function(pos,node) action_on = function(pos,node)
local isClosed = getClosed(pos) local isClosed = getClosed(pos)
if isClosed then if isClosed then
@ -405,6 +408,7 @@ for i, g in ipairs(gate_list) do
end, end,
mesecons = { mesecons = {
effector = { effector = {
rules = m_rules,
action_on = function(pos,node) homedecor.flip_gate(pos,node,nil,gate, "closed") end action_on = function(pos,node) homedecor.flip_gate(pos,node,nil,gate, "closed") end
} }
} }
@ -433,6 +437,7 @@ for i, g in ipairs(gate_list) do
return itemstack return itemstack
end end
def.mesecons.effector = { def.mesecons.effector = {
rules = m_rules,
action_off = function(pos,node) homedecor.flip_gate(pos,node,nil,gate, "open") end action_off = function(pos,node) homedecor.flip_gate(pos,node,nil,gate, "open") end
} }