Adjust redstone rules of most redstone components
This commit is contained in:
parent
a4b229e565
commit
a34405b17b
8 changed files with 28 additions and 51 deletions
|
@ -2,31 +2,9 @@
|
|||
-- A button that when pressed emits power for 1 second
|
||||
-- and then turns off again
|
||||
|
||||
-- FIXME: Power lower/upper nodes as well
|
||||
-- FIXME: Power node behind as well
|
||||
local button_get_output_rules = function(node)
|
||||
local rules = {
|
||||
{x = -1, y = 0, z = 0},
|
||||
{x = 1, y = 0, z = 0},
|
||||
{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=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
|
||||
local rules = mesecon.rules.alldirs
|
||||
return rules
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue