mirror of
https://github.com/minetest-mods/mesecons.git
synced 2025-04-15 08:20:31 +02:00
Avoid most node copies
This commit is contained in:
parent
468ec521ea
commit
d4acc6a8a6
@ -59,6 +59,10 @@ end
|
|||||||
local function get_rules(def, node)
|
local function get_rules(def, node)
|
||||||
local rules = def.rules
|
local rules = def.rules
|
||||||
if type(rules) == 'function' then
|
if type(rules) == 'function' then
|
||||||
|
if not def.const_node then
|
||||||
|
-- Copy the node to avoid overwriting data in the cache
|
||||||
|
node = {name = node.name, param1 = node.param1, param2 = node.param2}
|
||||||
|
end
|
||||||
return rules(node)
|
return rules(node)
|
||||||
elseif rules then
|
elseif rules then
|
||||||
return rules
|
return rules
|
||||||
@ -336,7 +340,7 @@ end
|
|||||||
-- some more general high-level stuff
|
-- some more general high-level stuff
|
||||||
|
|
||||||
function mesecon.is_power_on(pos, rulename)
|
function mesecon.is_power_on(pos, rulename)
|
||||||
local node = mesecon.get_node_force(pos)
|
local node = mesecon.get_node_force_nocopy(pos)
|
||||||
if node and (mesecon.is_conductor_on(node, rulename) or mesecon.is_receptor_on(node.name)) then
|
if node and (mesecon.is_conductor_on(node, rulename) or mesecon.is_receptor_on(node.name)) then
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
@ -344,7 +348,7 @@ function mesecon.is_power_on(pos, rulename)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function mesecon.is_power_off(pos, rulename)
|
function mesecon.is_power_off(pos, rulename)
|
||||||
local node = mesecon.get_node_force(pos)
|
local node = mesecon.get_node_force_nocopy(pos)
|
||||||
if node and (mesecon.is_conductor_off(node, rulename) or mesecon.is_receptor_off(node.name)) then
|
if node and (mesecon.is_conductor_off(node, rulename) or mesecon.is_receptor_off(node.name)) then
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
@ -410,7 +414,7 @@ function mesecon.turnon(pos, link)
|
|||||||
|
|
||||||
local depth = 1
|
local depth = 1
|
||||||
for f in frontiers:iter() do
|
for f in frontiers:iter() do
|
||||||
local node = mesecon.get_node_force(f.pos)
|
local node = mesecon.get_node_force_nocopy(f.pos)
|
||||||
|
|
||||||
if not node then
|
if not node then
|
||||||
-- Area does not exist; do nothing
|
-- Area does not exist; do nothing
|
||||||
@ -475,7 +479,7 @@ function mesecon.turnoff(pos, link)
|
|||||||
|
|
||||||
local depth = 1
|
local depth = 1
|
||||||
for f in frontiers:iter() do
|
for f in frontiers:iter() do
|
||||||
local node = mesecon.get_node_force(f.pos)
|
local node = mesecon.get_node_force_nocopy(f.pos)
|
||||||
|
|
||||||
if not node then
|
if not node then
|
||||||
-- Area does not exist; do nothing
|
-- Area does not exist; do nothing
|
||||||
@ -492,7 +496,7 @@ function mesecon.turnoff(pos, link)
|
|||||||
-- abort this turnoff process by returning false. `receptor_off` will
|
-- abort this turnoff process by returning false. `receptor_off` will
|
||||||
-- discard all the changes that we made in the voxelmanip:
|
-- discard all the changes that we made in the voxelmanip:
|
||||||
if mesecon.link_inverted(f.pos, np) then
|
if mesecon.link_inverted(f.pos, np) then
|
||||||
if mesecon.is_receptor_on(mesecon.get_node_force(np).name) then
|
if mesecon.is_receptor_on(mesecon.get_node_force_nocopy(np).name) then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -538,7 +542,7 @@ end
|
|||||||
-- Get the linking inputrule of inputnode (effector or conductor) that is connected to
|
-- Get the linking inputrule of inputnode (effector or conductor) that is connected to
|
||||||
-- outputnode (receptor or conductor) between positions `output` and `input`
|
-- outputnode (receptor or conductor) between positions `output` and `input`
|
||||||
function mesecon.link(output, input)
|
function mesecon.link(output, input)
|
||||||
local inputnode = mesecon.get_node_force(input)
|
local inputnode = mesecon.get_node_force_nocopy(input)
|
||||||
local inputrules = mesecon.get_any_inputrules(inputnode)
|
local inputrules = mesecon.get_any_inputrules(inputnode)
|
||||||
if not inputrules then return end
|
if not inputrules then return end
|
||||||
|
|
||||||
@ -554,7 +558,7 @@ end
|
|||||||
-- Get the linking outputrule of outputnode (receptor or conductor) that is connected to
|
-- Get the linking outputrule of outputnode (receptor or conductor) that is connected to
|
||||||
-- inputnode (effector or conductor) between positions `input` and `output`
|
-- inputnode (effector or conductor) between positions `input` and `output`
|
||||||
function mesecon.link_inverted(input, output)
|
function mesecon.link_inverted(input, output)
|
||||||
local outputnode = mesecon.get_node_force(output)
|
local outputnode = mesecon.get_node_force_nocopy(output)
|
||||||
local outputrules = mesecon.get_any_outputrules(outputnode)
|
local outputrules = mesecon.get_any_outputrules(outputnode)
|
||||||
if not outputrules then return end
|
if not outputrules then return end
|
||||||
|
|
||||||
@ -567,7 +571,7 @@ function mesecon.link_inverted(input, output)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function mesecon.is_powered(pos, rule)
|
function mesecon.is_powered(pos, rule)
|
||||||
local node = mesecon.get_node_force(pos)
|
local node = mesecon.get_node_force_nocopy(pos)
|
||||||
local rules = mesecon.get_any_inputrules(node)
|
local rules = mesecon.get_any_inputrules(node)
|
||||||
if not rules then return false end
|
if not rules then return false end
|
||||||
|
|
||||||
@ -579,7 +583,7 @@ function mesecon.is_powered(pos, rule)
|
|||||||
local rname = mesecon.link_inverted(pos, vector.add(pos, rule))
|
local rname = mesecon.link_inverted(pos, vector.add(pos, rule))
|
||||||
if rname then
|
if rname then
|
||||||
local np = vector.add(pos, rname)
|
local np = vector.add(pos, rname)
|
||||||
local nn = mesecon.get_node_force(np)
|
local nn = mesecon.get_node_force_nocopy(np)
|
||||||
|
|
||||||
if (mesecon.is_conductor_on(nn, mesecon.invertRule(rname))
|
if (mesecon.is_conductor_on(nn, mesecon.invertRule(rname))
|
||||||
or mesecon.is_receptor_on(nn.name)) then
|
or mesecon.is_receptor_on(nn.name)) then
|
||||||
@ -591,7 +595,7 @@ function mesecon.is_powered(pos, rule)
|
|||||||
local rname = mesecon.link_inverted(pos, vector.add(pos, rule))
|
local rname = mesecon.link_inverted(pos, vector.add(pos, rule))
|
||||||
if rname then
|
if rname then
|
||||||
local np = vector.add(pos, rname)
|
local np = vector.add(pos, rname)
|
||||||
local nn = mesecon.get_node_force(np)
|
local nn = mesecon.get_node_force_nocopy(np)
|
||||||
if (mesecon.is_conductor_on (nn, mesecon.invertRule(rname))
|
if (mesecon.is_conductor_on (nn, mesecon.invertRule(rname))
|
||||||
or mesecon.is_receptor_on (nn.name)) then
|
or mesecon.is_receptor_on (nn.name)) then
|
||||||
table.insert(sourcepos, np)
|
table.insert(sourcepos, np)
|
||||||
|
@ -390,16 +390,21 @@ local function vm_get_or_create_entry(pos)
|
|||||||
return tbl
|
return tbl
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Gets the node at a given position during a VoxelManipulator-based
|
local function vm_get_node_nocopy(pos)
|
||||||
-- transaction.
|
|
||||||
function mesecon.vm_get_node(pos)
|
|
||||||
local hash = minetest.hash_node_position(pos)
|
local hash = minetest.hash_node_position(pos)
|
||||||
local node = vm_node_cache[hash]
|
local node = vm_node_cache[hash]
|
||||||
if not node then
|
if not node then
|
||||||
node = vm_get_or_create_entry(pos).vm:get_node_at(pos)
|
node = vm_get_or_create_entry(pos).vm:get_node_at(pos)
|
||||||
vm_node_cache[hash] = node
|
vm_node_cache[hash] = node
|
||||||
end
|
end
|
||||||
return node.name ~= "ignore" and {name = node.name, param1 = node.param1, param2 = node.param2} or nil
|
return node.name ~= "ignore" and node or nil
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Gets the node at a given position during a VoxelManipulator-based
|
||||||
|
-- transaction.
|
||||||
|
function mesecon.vm_get_node(pos)
|
||||||
|
local node = vm_get_node_nocopy(pos)
|
||||||
|
return node and {name = node.name, param1 = node.param1, param2 = node.param2}
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Sets a node’s name during a VoxelManipulator-based transaction.
|
-- Sets a node’s name during a VoxelManipulator-based transaction.
|
||||||
@ -424,6 +429,18 @@ function mesecon.vm_swap_node(pos, name, update_light)
|
|||||||
tbl.dirty = true
|
tbl.dirty = true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Get node, loading map if necessary.
|
||||||
|
local function get_node_load(pos)
|
||||||
|
local node = minetest.get_node_or_nil(pos)
|
||||||
|
if node == nil then
|
||||||
|
-- Node is not currently loaded; use a VoxelManipulator to prime
|
||||||
|
-- the mapblock cache and try again.
|
||||||
|
minetest.get_voxel_manip(pos, pos)
|
||||||
|
node = minetest.get_node_or_nil(pos)
|
||||||
|
end
|
||||||
|
return node
|
||||||
|
end
|
||||||
|
|
||||||
-- Gets the node at a given position, regardless of whether it is loaded or
|
-- Gets the node at a given position, regardless of whether it is loaded or
|
||||||
-- not, respecting a transaction if one is in progress.
|
-- not, respecting a transaction if one is in progress.
|
||||||
--
|
--
|
||||||
@ -435,14 +452,16 @@ function mesecon.get_node_force(pos)
|
|||||||
if vm_cache then
|
if vm_cache then
|
||||||
return mesecon.vm_get_node(pos)
|
return mesecon.vm_get_node(pos)
|
||||||
else
|
else
|
||||||
local node = minetest.get_node_or_nil(pos)
|
return get_node_load(pos)
|
||||||
if node == nil then
|
end
|
||||||
-- Node is not currently loaded; use a VoxelManipulator to prime
|
end
|
||||||
-- the mapblock cache and try again.
|
|
||||||
minetest.get_voxel_manip(pos, pos)
|
-- Same without copying the internal node. Not part of public API.
|
||||||
node = minetest.get_node_or_nil(pos)
|
function mesecon.get_node_force_nocopy(pos)
|
||||||
end
|
if vm_cache then
|
||||||
return node
|
return vm_get_node_nocopy(pos)
|
||||||
|
else
|
||||||
|
return get_node_load(pos)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -55,6 +55,7 @@ minetest.register_node("mesecons_button:button_off", {
|
|||||||
sounds = mesecon.node_sound.stone,
|
sounds = mesecon.node_sound.stone,
|
||||||
mesecons = {receptor = {
|
mesecons = {receptor = {
|
||||||
state = mesecon.state.off,
|
state = mesecon.state.off,
|
||||||
|
const_node = true,
|
||||||
rules = mesecon.rules.buttonlike_get
|
rules = mesecon.rules.buttonlike_get
|
||||||
}},
|
}},
|
||||||
on_blast = mesecon.on_blastnode,
|
on_blast = mesecon.on_blastnode,
|
||||||
@ -96,6 +97,7 @@ minetest.register_node("mesecons_button:button_on", {
|
|||||||
sounds = mesecon.node_sound.stone,
|
sounds = mesecon.node_sound.stone,
|
||||||
mesecons = {receptor = {
|
mesecons = {receptor = {
|
||||||
state = mesecon.state.on,
|
state = mesecon.state.on,
|
||||||
|
const_node = true,
|
||||||
rules = mesecon.rules.buttonlike_get
|
rules = mesecon.rules.buttonlike_get
|
||||||
}},
|
}},
|
||||||
on_timer = mesecon.button_turnoff,
|
on_timer = mesecon.button_turnoff,
|
||||||
|
@ -108,10 +108,12 @@ local off_state = {
|
|||||||
receptor =
|
receptor =
|
||||||
{
|
{
|
||||||
state = mesecon.state.off,
|
state = mesecon.state.off,
|
||||||
|
const_node = true,
|
||||||
rules = delayer_get_output_rules
|
rules = delayer_get_output_rules
|
||||||
},
|
},
|
||||||
effector =
|
effector =
|
||||||
{
|
{
|
||||||
|
const_node = true,
|
||||||
rules = delayer_get_input_rules,
|
rules = delayer_get_input_rules,
|
||||||
action_on = delayer_activate
|
action_on = delayer_activate
|
||||||
}
|
}
|
||||||
|
@ -34,6 +34,7 @@ minetest.register_node("mesecons_extrawires:corner_on", {
|
|||||||
mesecons = {conductor =
|
mesecons = {conductor =
|
||||||
{
|
{
|
||||||
state = mesecon.state.on,
|
state = mesecon.state.on,
|
||||||
|
const_node = true,
|
||||||
rules = corner_get_rules,
|
rules = corner_get_rules,
|
||||||
offstate = "mesecons_extrawires:corner_off"
|
offstate = "mesecons_extrawires:corner_off"
|
||||||
}},
|
}},
|
||||||
@ -60,6 +61,7 @@ minetest.register_node("mesecons_extrawires:corner_off", {
|
|||||||
mesecons = {conductor =
|
mesecons = {conductor =
|
||||||
{
|
{
|
||||||
state = mesecon.state.off,
|
state = mesecon.state.off,
|
||||||
|
const_node = true,
|
||||||
rules = corner_get_rules,
|
rules = corner_get_rules,
|
||||||
onstate = "mesecons_extrawires:corner_on"
|
onstate = "mesecons_extrawires:corner_on"
|
||||||
}},
|
}},
|
||||||
|
@ -62,6 +62,7 @@ for k, state in ipairs(doublecorner_states) do
|
|||||||
mesecons = {
|
mesecons = {
|
||||||
conductor = {
|
conductor = {
|
||||||
states = doublecorner_states,
|
states = doublecorner_states,
|
||||||
|
const_node = true,
|
||||||
rules = doublecorner_get_rules,
|
rules = doublecorner_get_rules,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -46,6 +46,7 @@ minetest.register_node("mesecons_extrawires:tjunction_on", {
|
|||||||
mesecons = {conductor =
|
mesecons = {conductor =
|
||||||
{
|
{
|
||||||
state = mesecon.state.on,
|
state = mesecon.state.on,
|
||||||
|
const_node = true,
|
||||||
rules = tjunction_get_rules,
|
rules = tjunction_get_rules,
|
||||||
offstate = "mesecons_extrawires:tjunction_off"
|
offstate = "mesecons_extrawires:tjunction_off"
|
||||||
}},
|
}},
|
||||||
@ -76,6 +77,7 @@ minetest.register_node("mesecons_extrawires:tjunction_off", {
|
|||||||
mesecons = {conductor =
|
mesecons = {conductor =
|
||||||
{
|
{
|
||||||
state = mesecon.state.off,
|
state = mesecon.state.off,
|
||||||
|
const_node = true,
|
||||||
rules = tjunction_get_rules,
|
rules = tjunction_get_rules,
|
||||||
onstate = "mesecons_extrawires:tjunction_on"
|
onstate = "mesecons_extrawires:tjunction_on"
|
||||||
}},
|
}},
|
||||||
|
@ -99,8 +99,10 @@ local function register_gate(name, inputnumber, assess, recipe, description)
|
|||||||
groups = {dig_immediate = 2, overheat = 1},
|
groups = {dig_immediate = 2, overheat = 1},
|
||||||
mesecons = { receptor = {
|
mesecons = { receptor = {
|
||||||
state = "off",
|
state = "off",
|
||||||
|
const_node = true,
|
||||||
rules = gate_get_output_rules
|
rules = gate_get_output_rules
|
||||||
}, effector = {
|
}, effector = {
|
||||||
|
const_node = true,
|
||||||
rules = get_inputrules,
|
rules = get_inputrules,
|
||||||
action_change = update_gate
|
action_change = update_gate
|
||||||
}}
|
}}
|
||||||
@ -118,8 +120,10 @@ local function register_gate(name, inputnumber, assess, recipe, description)
|
|||||||
groups = {dig_immediate = 2, not_in_creative_inventory = 1, overheat = 1},
|
groups = {dig_immediate = 2, not_in_creative_inventory = 1, overheat = 1},
|
||||||
mesecons = { receptor = {
|
mesecons = { receptor = {
|
||||||
state = "on",
|
state = "on",
|
||||||
|
const_node = true,
|
||||||
rules = gate_get_output_rules
|
rules = gate_get_output_rules
|
||||||
}, effector = {
|
}, effector = {
|
||||||
|
const_node = true,
|
||||||
rules = get_inputrules,
|
rules = get_inputrules,
|
||||||
action_change = update_gate
|
action_change = update_gate
|
||||||
}}
|
}}
|
||||||
|
@ -38,6 +38,7 @@ minetest.register_node("mesecons_insulated:insulated_on", {
|
|||||||
mesecons = {conductor = {
|
mesecons = {conductor = {
|
||||||
state = mesecon.state.on,
|
state = mesecon.state.on,
|
||||||
offstate = "mesecons_insulated:insulated_off",
|
offstate = "mesecons_insulated:insulated_off",
|
||||||
|
const_node = true,
|
||||||
rules = insulated_wire_get_rules
|
rules = insulated_wire_get_rules
|
||||||
}},
|
}},
|
||||||
on_blast = mesecon.on_blastnode,
|
on_blast = mesecon.on_blastnode,
|
||||||
@ -74,6 +75,7 @@ minetest.register_node("mesecons_insulated:insulated_off", {
|
|||||||
mesecons = {conductor = {
|
mesecons = {conductor = {
|
||||||
state = mesecon.state.off,
|
state = mesecon.state.off,
|
||||||
onstate = "mesecons_insulated:insulated_on",
|
onstate = "mesecons_insulated:insulated_on",
|
||||||
|
const_node = true,
|
||||||
rules = insulated_wire_get_rules
|
rules = insulated_wire_get_rules
|
||||||
}},
|
}},
|
||||||
on_blast = mesecon.on_blastnode,
|
on_blast = mesecon.on_blastnode,
|
||||||
|
@ -31,6 +31,7 @@ minetest.register_node("mesecons_lamp:lamp_on", {
|
|||||||
action_off = function (pos, node)
|
action_off = function (pos, node)
|
||||||
minetest.swap_node(pos, {name = "mesecons_lamp:lamp_off", param2 = node.param2})
|
minetest.swap_node(pos, {name = "mesecons_lamp:lamp_off", param2 = node.param2})
|
||||||
end,
|
end,
|
||||||
|
const_node = true,
|
||||||
rules = mesecon.rules.wallmounted_get,
|
rules = mesecon.rules.wallmounted_get,
|
||||||
}},
|
}},
|
||||||
on_blast = mesecon.on_blastnode,
|
on_blast = mesecon.on_blastnode,
|
||||||
@ -56,6 +57,7 @@ minetest.register_node("mesecons_lamp:lamp_off", {
|
|||||||
action_on = function (pos, node)
|
action_on = function (pos, node)
|
||||||
minetest.swap_node(pos, {name = "mesecons_lamp:lamp_on", param2 = node.param2})
|
minetest.swap_node(pos, {name = "mesecons_lamp:lamp_on", param2 = node.param2})
|
||||||
end,
|
end,
|
||||||
|
const_node = true,
|
||||||
rules = mesecon.rules.wallmounted_get,
|
rules = mesecon.rules.wallmounted_get,
|
||||||
}},
|
}},
|
||||||
on_blast = mesecon.on_blastnode,
|
on_blast = mesecon.on_blastnode,
|
||||||
|
@ -281,6 +281,7 @@ minetest.register_node("mesecons_pistons:piston_normal_off", {
|
|||||||
sounds = mesecon.node_sound.wood,
|
sounds = mesecon.node_sound.wood,
|
||||||
mesecons = {effector={
|
mesecons = {effector={
|
||||||
action_on = piston_on,
|
action_on = piston_on,
|
||||||
|
const_node = true,
|
||||||
rules = piston_get_rules,
|
rules = piston_get_rules,
|
||||||
}},
|
}},
|
||||||
on_punch = piston_punch,
|
on_punch = piston_punch,
|
||||||
@ -311,6 +312,7 @@ minetest.register_node("mesecons_pistons:piston_normal_on", {
|
|||||||
sounds = mesecon.node_sound.wood,
|
sounds = mesecon.node_sound.wood,
|
||||||
mesecons = {effector={
|
mesecons = {effector={
|
||||||
action_off = piston_off,
|
action_off = piston_off,
|
||||||
|
const_node = true,
|
||||||
rules = piston_get_rules,
|
rules = piston_get_rules,
|
||||||
}},
|
}},
|
||||||
on_rotate = piston_rotate_on,
|
on_rotate = piston_rotate_on,
|
||||||
@ -360,6 +362,7 @@ minetest.register_node("mesecons_pistons:piston_sticky_off", {
|
|||||||
sounds = mesecon.node_sound.wood,
|
sounds = mesecon.node_sound.wood,
|
||||||
mesecons = {effector={
|
mesecons = {effector={
|
||||||
action_on = piston_on,
|
action_on = piston_on,
|
||||||
|
const_node = true,
|
||||||
rules = piston_get_rules,
|
rules = piston_get_rules,
|
||||||
}},
|
}},
|
||||||
on_punch = piston_punch,
|
on_punch = piston_punch,
|
||||||
@ -390,6 +393,7 @@ minetest.register_node("mesecons_pistons:piston_sticky_on", {
|
|||||||
sounds = mesecon.node_sound.wood,
|
sounds = mesecon.node_sound.wood,
|
||||||
mesecons = {effector={
|
mesecons = {effector={
|
||||||
action_off = piston_off,
|
action_off = piston_off,
|
||||||
|
const_node = true,
|
||||||
rules = piston_get_rules,
|
rules = piston_get_rules,
|
||||||
}},
|
}},
|
||||||
on_rotate = piston_rotate_on,
|
on_rotate = piston_rotate_on,
|
||||||
|
@ -68,6 +68,7 @@ mesecon.register_node("mesecons_receiver:receiver", {
|
|||||||
},
|
},
|
||||||
mesecons = {conductor = {
|
mesecons = {conductor = {
|
||||||
state = mesecon.state.off,
|
state = mesecon.state.off,
|
||||||
|
const_node = true,
|
||||||
rules = receiver_get_rules,
|
rules = receiver_get_rules,
|
||||||
onstate = "mesecons_receiver:receiver_on"
|
onstate = "mesecons_receiver:receiver_on"
|
||||||
}}
|
}}
|
||||||
|
@ -21,12 +21,14 @@ mesecon.register_node("mesecons_solarpanel:solar_panel", {
|
|||||||
groups = {dig_immediate = 3},
|
groups = {dig_immediate = 3},
|
||||||
mesecons = {receptor = {
|
mesecons = {receptor = {
|
||||||
state = mesecon.state.off,
|
state = mesecon.state.off,
|
||||||
|
const_node = true,
|
||||||
rules = mesecon.rules.wallmounted_get
|
rules = mesecon.rules.wallmounted_get
|
||||||
}}
|
}}
|
||||||
},{
|
},{
|
||||||
groups = {dig_immediate = 3, not_in_creative_inventory = 1},
|
groups = {dig_immediate = 3, not_in_creative_inventory = 1},
|
||||||
mesecons = {receptor = {
|
mesecons = {receptor = {
|
||||||
state = mesecon.state.on,
|
state = mesecon.state.on,
|
||||||
|
const_node = true,
|
||||||
rules = mesecon.rules.wallmounted_get
|
rules = mesecon.rules.wallmounted_get
|
||||||
}},
|
}},
|
||||||
})
|
})
|
||||||
|
@ -67,6 +67,7 @@ minetest.register_node("mesecons_torch:mesecon_torch_off", {
|
|||||||
sounds = mesecon.node_sound.default,
|
sounds = mesecon.node_sound.default,
|
||||||
mesecons = {receptor = {
|
mesecons = {receptor = {
|
||||||
state = mesecon.state.off,
|
state = mesecon.state.off,
|
||||||
|
const_node = true,
|
||||||
rules = torch_get_output_rules
|
rules = torch_get_output_rules
|
||||||
}},
|
}},
|
||||||
on_blast = mesecon.on_blastnode,
|
on_blast = mesecon.on_blastnode,
|
||||||
|
@ -34,6 +34,7 @@ mesecon.register_node("mesecons_walllever:wall_lever", {
|
|||||||
mesh="jeija_wall_lever_off.obj",
|
mesh="jeija_wall_lever_off.obj",
|
||||||
on_rotate = mesecon.buttonlike_onrotate,
|
on_rotate = mesecon.buttonlike_onrotate,
|
||||||
mesecons = {receptor = {
|
mesecons = {receptor = {
|
||||||
|
const_node = true,
|
||||||
rules = mesecon.rules.buttonlike_get,
|
rules = mesecon.rules.buttonlike_get,
|
||||||
state = mesecon.state.off
|
state = mesecon.state.off
|
||||||
}},
|
}},
|
||||||
@ -48,6 +49,7 @@ mesecon.register_node("mesecons_walllever:wall_lever", {
|
|||||||
mesh="jeija_wall_lever_on.obj",
|
mesh="jeija_wall_lever_on.obj",
|
||||||
on_rotate = false,
|
on_rotate = false,
|
||||||
mesecons = {receptor = {
|
mesecons = {receptor = {
|
||||||
|
const_node = true,
|
||||||
rules = mesecon.rules.buttonlike_get,
|
rules = mesecon.rules.buttonlike_get,
|
||||||
state = mesecon.state.on
|
state = mesecon.state.on
|
||||||
}},
|
}},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user