Rename const_node to rule_node_nocopy

This commit is contained in:
Jude Melton-Houghton 2022-05-29 16:24:25 -04:00
parent 569677dee4
commit 49645b10b5
14 changed files with 28 additions and 28 deletions

View File

@ -59,7 +59,7 @@ end
local function get_rules(def, node)
local rules = def.rules
if type(rules) == 'function' then
if not def.const_node then
if not def.rule_node_nocopy then
-- Copy the node to avoid overwriting data in the cache
node = {name = node.name, param1 = node.param1, param2 = node.param2}
end

View File

@ -55,7 +55,7 @@ minetest.register_node("mesecons_button:button_off", {
sounds = mesecon.node_sound.stone,
mesecons = {receptor = {
state = mesecon.state.off,
const_node = true,
rule_node_nocopy = true,
rules = mesecon.rules.buttonlike_get
}},
on_blast = mesecon.on_blastnode,
@ -97,7 +97,7 @@ minetest.register_node("mesecons_button:button_on", {
sounds = mesecon.node_sound.stone,
mesecons = {receptor = {
state = mesecon.state.on,
const_node = true,
rule_node_nocopy = true,
rules = mesecon.rules.buttonlike_get
}},
on_timer = mesecon.button_turnoff,

View File

@ -108,12 +108,12 @@ local off_state = {
receptor =
{
state = mesecon.state.off,
const_node = true,
rule_node_nocopy = true,
rules = delayer_get_output_rules
},
effector =
{
const_node = true,
rule_node_nocopy = true,
rules = delayer_get_input_rules,
action_on = delayer_activate
}

View File

@ -34,7 +34,7 @@ minetest.register_node("mesecons_extrawires:corner_on", {
mesecons = {conductor =
{
state = mesecon.state.on,
const_node = true,
rule_node_nocopy = true,
rules = corner_get_rules,
offstate = "mesecons_extrawires:corner_off"
}},
@ -61,7 +61,7 @@ minetest.register_node("mesecons_extrawires:corner_off", {
mesecons = {conductor =
{
state = mesecon.state.off,
const_node = true,
rule_node_nocopy = true,
rules = corner_get_rules,
onstate = "mesecons_extrawires:corner_on"
}},

View File

@ -62,7 +62,7 @@ for k, state in ipairs(doublecorner_states) do
mesecons = {
conductor = {
states = doublecorner_states,
const_node = true,
rule_node_nocopy = true,
rules = doublecorner_get_rules,
},
},

View File

@ -46,7 +46,7 @@ minetest.register_node("mesecons_extrawires:tjunction_on", {
mesecons = {conductor =
{
state = mesecon.state.on,
const_node = true,
rule_node_nocopy = true,
rules = tjunction_get_rules,
offstate = "mesecons_extrawires:tjunction_off"
}},
@ -77,7 +77,7 @@ minetest.register_node("mesecons_extrawires:tjunction_off", {
mesecons = {conductor =
{
state = mesecon.state.off,
const_node = true,
rule_node_nocopy = true,
rules = tjunction_get_rules,
onstate = "mesecons_extrawires:tjunction_on"
}},

View File

@ -99,10 +99,10 @@ local function register_gate(name, inputnumber, assess, recipe, description)
groups = {dig_immediate = 2, overheat = 1},
mesecons = { receptor = {
state = "off",
const_node = true,
rule_node_nocopy = true,
rules = gate_get_output_rules
}, effector = {
const_node = true,
rule_node_nocopy = true,
rules = get_inputrules,
action_change = update_gate
}}
@ -120,10 +120,10 @@ local function register_gate(name, inputnumber, assess, recipe, description)
groups = {dig_immediate = 2, not_in_creative_inventory = 1, overheat = 1},
mesecons = { receptor = {
state = "on",
const_node = true,
rule_node_nocopy = true,
rules = gate_get_output_rules
}, effector = {
const_node = true,
rule_node_nocopy = true,
rules = get_inputrules,
action_change = update_gate
}}

View File

@ -38,7 +38,7 @@ minetest.register_node("mesecons_insulated:insulated_on", {
mesecons = {conductor = {
state = mesecon.state.on,
offstate = "mesecons_insulated:insulated_off",
const_node = true,
rule_node_nocopy = true,
rules = insulated_wire_get_rules
}},
on_blast = mesecon.on_blastnode,
@ -75,7 +75,7 @@ minetest.register_node("mesecons_insulated:insulated_off", {
mesecons = {conductor = {
state = mesecon.state.off,
onstate = "mesecons_insulated:insulated_on",
const_node = true,
rule_node_nocopy = true,
rules = insulated_wire_get_rules
}},
on_blast = mesecon.on_blastnode,

View File

@ -31,7 +31,7 @@ minetest.register_node("mesecons_lamp:lamp_on", {
action_off = function (pos, node)
minetest.swap_node(pos, {name = "mesecons_lamp:lamp_off", param2 = node.param2})
end,
const_node = true,
rule_node_nocopy = true,
rules = mesecon.rules.wallmounted_get,
}},
on_blast = mesecon.on_blastnode,
@ -57,7 +57,7 @@ minetest.register_node("mesecons_lamp:lamp_off", {
action_on = function (pos, node)
minetest.swap_node(pos, {name = "mesecons_lamp:lamp_on", param2 = node.param2})
end,
const_node = true,
rule_node_nocopy = true,
rules = mesecon.rules.wallmounted_get,
}},
on_blast = mesecon.on_blastnode,

View File

@ -281,7 +281,7 @@ minetest.register_node("mesecons_pistons:piston_normal_off", {
sounds = mesecon.node_sound.wood,
mesecons = {effector={
action_on = piston_on,
const_node = true,
rule_node_nocopy = true,
rules = piston_get_rules,
}},
on_punch = piston_punch,
@ -312,7 +312,7 @@ minetest.register_node("mesecons_pistons:piston_normal_on", {
sounds = mesecon.node_sound.wood,
mesecons = {effector={
action_off = piston_off,
const_node = true,
rule_node_nocopy = true,
rules = piston_get_rules,
}},
on_rotate = piston_rotate_on,
@ -362,7 +362,7 @@ minetest.register_node("mesecons_pistons:piston_sticky_off", {
sounds = mesecon.node_sound.wood,
mesecons = {effector={
action_on = piston_on,
const_node = true,
rule_node_nocopy = true,
rules = piston_get_rules,
}},
on_punch = piston_punch,
@ -393,7 +393,7 @@ minetest.register_node("mesecons_pistons:piston_sticky_on", {
sounds = mesecon.node_sound.wood,
mesecons = {effector={
action_off = piston_off,
const_node = true,
rule_node_nocopy = true,
rules = piston_get_rules,
}},
on_rotate = piston_rotate_on,

View File

@ -68,7 +68,7 @@ mesecon.register_node("mesecons_receiver:receiver", {
},
mesecons = {conductor = {
state = mesecon.state.off,
const_node = true,
rule_node_nocopy = true,
rules = receiver_get_rules,
onstate = "mesecons_receiver:receiver_on"
}}

View File

@ -21,14 +21,14 @@ mesecon.register_node("mesecons_solarpanel:solar_panel", {
groups = {dig_immediate = 3},
mesecons = {receptor = {
state = mesecon.state.off,
const_node = true,
rule_node_nocopy = true,
rules = mesecon.rules.wallmounted_get
}}
},{
groups = {dig_immediate = 3, not_in_creative_inventory = 1},
mesecons = {receptor = {
state = mesecon.state.on,
const_node = true,
rule_node_nocopy = true,
rules = mesecon.rules.wallmounted_get
}},
})

View File

@ -67,7 +67,7 @@ minetest.register_node("mesecons_torch:mesecon_torch_off", {
sounds = mesecon.node_sound.default,
mesecons = {receptor = {
state = mesecon.state.off,
const_node = true,
rule_node_nocopy = true,
rules = torch_get_output_rules
}},
on_blast = mesecon.on_blastnode,

View File

@ -34,7 +34,7 @@ mesecon.register_node("mesecons_walllever:wall_lever", {
mesh="jeija_wall_lever_off.obj",
on_rotate = mesecon.buttonlike_onrotate,
mesecons = {receptor = {
const_node = true,
rule_node_nocopy = true,
rules = mesecon.rules.buttonlike_get,
state = mesecon.state.off
}},
@ -49,7 +49,7 @@ mesecon.register_node("mesecons_walllever:wall_lever", {
mesh="jeija_wall_lever_on.obj",
on_rotate = false,
mesecons = {receptor = {
const_node = true,
rule_node_nocopy = true,
rules = mesecon.rules.buttonlike_get,
state = mesecon.state.on
}},