Tweak button/pressure plate connection sides

This commit is contained in:
Wuzzy 2017-09-12 05:37:03 +02:00
parent 427eb32448
commit be135b7066
2 changed files with 34 additions and 5 deletions

View file

@ -10,9 +10,22 @@ local button_get_output_rules = function(node)
{x = 0, y = 0, z = -1},
{x = 0, y = 0, z = 1},
{x = 0, y = -1, z = 0},
{x = 0, y = 1, z = 0},
}
if minetest.wallmounted_to_dir(node.param2).y == 1 then
table.insert(rules, {x=0, y=1, z=1})
table.insert(rules, {x=0, y=2, z=0})
elseif minetest.wallmounted_to_dir(node.param2).y == -1 then
table.insert(rules, {x=0, y=-2, z=0})
end
if minetest.wallmounted_to_dir(node.param2).x == 1 then
table.insert(rules, {x=2, y=0, z=0})
elseif minetest.wallmounted_to_dir(node.param2).x == -1 then
table.insert(rules, {x=-2, y=0, z=0})
end
if minetest.wallmounted_to_dir(node.param2).z == 1 then
table.insert(rules, {x=0, y=0, z=2})
elseif minetest.wallmounted_to_dir(node.param2).z == -1 then
table.insert(rules, {x=-0, y=0, z=-2})
end
return rules
end