mirror of
https://github.com/minetest-mods/mesecons.git
synced 2025-06-28 13:56:02 +02:00
Port more blocks to nodedef system: object detector, extrawires, water turbine, insulated wire
This commit is contained in:
@ -290,7 +290,7 @@ function mesecon:turnon(pos)
|
||||
|
||||
if mesecon:is_conductor_off(node.name) then
|
||||
local rules = mesecon:conductor_get_rules(node)
|
||||
minetest.env:add_node(pos, {name=mesecon:get_conductor_on(node.name), param2 = node.param2})
|
||||
mesecon:swap_node(pos, mesecon:get_conductor_on(node.name))
|
||||
|
||||
for _, rule in ipairs(rules) do
|
||||
local np = mesecon:addPosRule(pos, rule)
|
||||
@ -314,7 +314,7 @@ function mesecon:turnoff(pos) --receptor rules used because output could have be
|
||||
|
||||
if mesecon:is_conductor_on(node.name) then
|
||||
local rules = mesecon:conductor_get_rules(node)
|
||||
minetest.env:add_node(pos, {name=mesecon:get_conductor_off(node.name), param2 = node.param2})
|
||||
mesecon:swap_node(pos, mesecon:get_conductor_off(node.name))
|
||||
|
||||
for _, rule in ipairs(rules) do
|
||||
local np = mesecon:addPosRule(pos, rule)
|
||||
|
@ -23,5 +23,22 @@ mesecon.rules.buttonlike =
|
||||
{x = 1, y =-1, z =-1},
|
||||
{x = 2, y = 0, z = 0}}
|
||||
|
||||
mesecon.rules.pressurplatelike =
|
||||
{{x=0, y=1, z=-1},
|
||||
{x=0, y=0, z=-1},
|
||||
{x=0, y=-1, z=-1},
|
||||
{x=0, y=1, z=1},
|
||||
{x=0, y=-1, z=1},
|
||||
{x=0, y=0, z=1},
|
||||
{x=1, y=0, z=0},
|
||||
{x=1, y=1, z=0},
|
||||
{x=1, y=-1, z=0},
|
||||
{x=-1, y=1, z=0},
|
||||
{x=-1, y=-1, z=0},
|
||||
{x=-1, y=0, z=0},
|
||||
{x=0, y=-1, z=0},
|
||||
{x=0, y=-2, z=0},
|
||||
{x=0, y=1, z=0}}
|
||||
|
||||
mesecon.state.on = "on"
|
||||
mesecon.state.off = "off"
|
||||
|
@ -2,3 +2,4 @@
|
||||
BLINKY_PLANT_INTERVAL = 3
|
||||
NEW_STYLE_WIRES = true -- true = new nodebox wires, false = old raillike wires
|
||||
PRESSURE_PLATE_INTERVAL = 0.1
|
||||
OBJECT_DETECTOR_RADIUS = 6
|
||||
|
Reference in New Issue
Block a user