mirror of
https://github.com/minetest-mods/mesecons.git
synced 2024-12-24 09:20:18 +01:00
Handle blasts (#356)
This commit is contained in:
parent
8999597df2
commit
905260c8db
@ -63,6 +63,13 @@ mesecon.on_dignode = function(pos, node)
|
|||||||
mesecon.execute_autoconnect_hooks_queue(pos, node)
|
mesecon.execute_autoconnect_hooks_queue(pos, node)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function mesecon.on_blastnode(pos, intensity)
|
||||||
|
local node = minetest.get_node(pos)
|
||||||
|
minetest.remove_node(pos)
|
||||||
|
mesecon.on_dignode(pos, node)
|
||||||
|
return minetest.get_node_drops(node.name, "")
|
||||||
|
end
|
||||||
|
|
||||||
minetest.register_on_placenode(mesecon.on_placenode)
|
minetest.register_on_placenode(mesecon.on_placenode)
|
||||||
minetest.register_on_dignode(mesecon.on_dignode)
|
minetest.register_on_dignode(mesecon.on_dignode)
|
||||||
|
|
||||||
|
@ -178,6 +178,7 @@ end
|
|||||||
|
|
||||||
function mesecon.register_node(name, spec_common, spec_off, spec_on)
|
function mesecon.register_node(name, spec_common, spec_off, spec_on)
|
||||||
spec_common.drop = spec_common.drop or name .. "_off"
|
spec_common.drop = spec_common.drop or name .. "_off"
|
||||||
|
spec_common.on_blast = spec_common.on_blast or mesecon.on_blastnode
|
||||||
spec_common.__mesecon_basename = name
|
spec_common.__mesecon_basename = name
|
||||||
spec_on.__mesecon_state = "on"
|
spec_on.__mesecon_state = "on"
|
||||||
spec_off.__mesecon_state = "off"
|
spec_off.__mesecon_state = "off"
|
||||||
|
@ -52,7 +52,8 @@ minetest.register_node("mesecons_button:button_off", {
|
|||||||
mesecons = {receptor = {
|
mesecons = {receptor = {
|
||||||
state = mesecon.state.off,
|
state = mesecon.state.off,
|
||||||
rules = mesecon.rules.buttonlike_get
|
rules = mesecon.rules.buttonlike_get
|
||||||
}}
|
}},
|
||||||
|
on_blast = mesecon.on_blastnode,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_node("mesecons_button:button_on", {
|
minetest.register_node("mesecons_button:button_on", {
|
||||||
@ -92,6 +93,7 @@ minetest.register_node("mesecons_button:button_on", {
|
|||||||
rules = mesecon.rules.buttonlike_get
|
rules = mesecon.rules.buttonlike_get
|
||||||
}},
|
}},
|
||||||
on_timer = mesecon.button_turnoff,
|
on_timer = mesecon.button_turnoff,
|
||||||
|
on_blast = mesecon.on_blastnode,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
|
@ -189,7 +189,8 @@ minetest.register_node("mesecons_commandblock:commandblock_off", {
|
|||||||
sounds = default.node_sound_stone_defaults(),
|
sounds = default.node_sound_stone_defaults(),
|
||||||
mesecons = {effector = {
|
mesecons = {effector = {
|
||||||
action_on = commandblock_action_on
|
action_on = commandblock_action_on
|
||||||
}}
|
}},
|
||||||
|
on_blast = mesecon.on_blastnode,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_node("mesecons_commandblock:commandblock_on", {
|
minetest.register_node("mesecons_commandblock:commandblock_on", {
|
||||||
@ -204,5 +205,6 @@ minetest.register_node("mesecons_commandblock:commandblock_on", {
|
|||||||
sounds = default.node_sound_stone_defaults(),
|
sounds = default.node_sound_stone_defaults(),
|
||||||
mesecons = {effector = {
|
mesecons = {effector = {
|
||||||
action_off = commandblock_action_off
|
action_off = commandblock_action_off
|
||||||
}}
|
}},
|
||||||
|
on_blast = mesecon.on_blastnode,
|
||||||
})
|
})
|
||||||
|
@ -114,7 +114,8 @@ minetest.register_node("mesecons_delayer:delayer_off_"..tostring(i), {
|
|||||||
rules = delayer_get_input_rules,
|
rules = delayer_get_input_rules,
|
||||||
action_on = delayer_activate
|
action_on = delayer_activate
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
on_blast = mesecon.on_blastnode,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
@ -168,7 +169,8 @@ minetest.register_node("mesecons_delayer:delayer_on_"..tostring(i), {
|
|||||||
rules = delayer_get_input_rules,
|
rules = delayer_get_input_rules,
|
||||||
action_off = delayer_deactivate
|
action_off = delayer_deactivate
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
on_blast = mesecon.on_blastnode,
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ local function object_detector_scan(pos)
|
|||||||
for _, str in pairs(string.split(scanname:gsub(" ", ""), ",")) do
|
for _, str in pairs(string.split(scanname:gsub(" ", ""), ",")) do
|
||||||
scan_for[str] = true
|
scan_for[str] = true
|
||||||
end
|
end
|
||||||
|
|
||||||
local every_player = scanname == ""
|
local every_player = scanname == ""
|
||||||
for _, obj in pairs(objs) do
|
for _, obj in pairs(objs) do
|
||||||
-- "" is returned if it is not a player; "" ~= nil; so only handle objects with foundname ~= ""
|
-- "" is returned if it is not a player; "" ~= nil; so only handle objects with foundname ~= ""
|
||||||
@ -76,7 +76,8 @@ minetest.register_node("mesecons_detector:object_detector_off", {
|
|||||||
on_construct = object_detector_make_formspec,
|
on_construct = object_detector_make_formspec,
|
||||||
on_receive_fields = object_detector_on_receive_fields,
|
on_receive_fields = object_detector_on_receive_fields,
|
||||||
sounds = default.node_sound_stone_defaults(),
|
sounds = default.node_sound_stone_defaults(),
|
||||||
digiline = object_detector_digiline
|
digiline = object_detector_digiline,
|
||||||
|
on_blast = mesecon.on_blastnode,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_node("mesecons_detector:object_detector_on", {
|
minetest.register_node("mesecons_detector:object_detector_on", {
|
||||||
@ -92,7 +93,8 @@ minetest.register_node("mesecons_detector:object_detector_on", {
|
|||||||
on_construct = object_detector_make_formspec,
|
on_construct = object_detector_make_formspec,
|
||||||
on_receive_fields = object_detector_on_receive_fields,
|
on_receive_fields = object_detector_on_receive_fields,
|
||||||
sounds = default.node_sound_stone_defaults(),
|
sounds = default.node_sound_stone_defaults(),
|
||||||
digiline = object_detector_digiline
|
digiline = object_detector_digiline,
|
||||||
|
on_blast = mesecon.on_blastnode,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
@ -181,12 +183,12 @@ local node_detector_digiline = {
|
|||||||
effector = {
|
effector = {
|
||||||
action = function(pos, node, channel, msg)
|
action = function(pos, node, channel, msg)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
|
|
||||||
local distance = meta:get_int("distance")
|
local distance = meta:get_int("distance")
|
||||||
local distance_max = mesecon.setting("node_detector_distance_max", 10)
|
local distance_max = mesecon.setting("node_detector_distance_max", 10)
|
||||||
if distance < 0 then distance = 0 end
|
if distance < 0 then distance = 0 end
|
||||||
if distance > distance_max then distance = distance_max end
|
if distance > distance_max then distance = distance_max end
|
||||||
|
|
||||||
if channel ~= meta:get_string("digiline_channel") then return end
|
if channel ~= meta:get_string("digiline_channel") then return end
|
||||||
|
|
||||||
if msg == GET_COMMAND then
|
if msg == GET_COMMAND then
|
||||||
@ -234,7 +236,8 @@ minetest.register_node("mesecons_detector:node_detector_off", {
|
|||||||
on_construct = node_detector_make_formspec,
|
on_construct = node_detector_make_formspec,
|
||||||
on_receive_fields = node_detector_on_receive_fields,
|
on_receive_fields = node_detector_on_receive_fields,
|
||||||
sounds = default.node_sound_stone_defaults(),
|
sounds = default.node_sound_stone_defaults(),
|
||||||
digiline = node_detector_digiline
|
digiline = node_detector_digiline,
|
||||||
|
on_blast = mesecon.on_blastnode,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_node("mesecons_detector:node_detector_on", {
|
minetest.register_node("mesecons_detector:node_detector_on", {
|
||||||
@ -250,7 +253,8 @@ minetest.register_node("mesecons_detector:node_detector_on", {
|
|||||||
on_construct = node_detector_make_formspec,
|
on_construct = node_detector_make_formspec,
|
||||||
on_receive_fields = node_detector_on_receive_fields,
|
on_receive_fields = node_detector_on_receive_fields,
|
||||||
sounds = default.node_sound_stone_defaults(),
|
sounds = default.node_sound_stone_defaults(),
|
||||||
digiline = node_detector_digiline
|
digiline = node_detector_digiline,
|
||||||
|
on_blast = mesecon.on_blastnode,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
|
@ -44,7 +44,8 @@ minetest.register_node("mesecons_extrawires:corner_on", {
|
|||||||
state = mesecon.state.on,
|
state = mesecon.state.on,
|
||||||
rules = corner_get_rules,
|
rules = corner_get_rules,
|
||||||
offstate = "mesecons_extrawires:corner_off"
|
offstate = "mesecons_extrawires:corner_off"
|
||||||
}}
|
}},
|
||||||
|
on_blast = mesecon.on_blastnode,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_node("mesecons_extrawires:corner_off", {
|
minetest.register_node("mesecons_extrawires:corner_off", {
|
||||||
@ -70,7 +71,8 @@ minetest.register_node("mesecons_extrawires:corner_off", {
|
|||||||
state = mesecon.state.off,
|
state = mesecon.state.off,
|
||||||
rules = corner_get_rules,
|
rules = corner_get_rules,
|
||||||
onstate = "mesecons_extrawires:corner_on"
|
onstate = "mesecons_extrawires:corner_on"
|
||||||
}}
|
}},
|
||||||
|
on_blast = mesecon.on_blastnode,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
|
@ -39,6 +39,7 @@ minetest.register_node("mesecons_extrawires:crossover_off", {
|
|||||||
rules = crossover_get_rules(),
|
rules = crossover_get_rules(),
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
on_blast = mesecon.on_blastnode,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_node("mesecons_extrawires:crossover_01", {
|
minetest.register_node("mesecons_extrawires:crossover_01", {
|
||||||
@ -63,6 +64,7 @@ minetest.register_node("mesecons_extrawires:crossover_01", {
|
|||||||
rules = crossover_get_rules(),
|
rules = crossover_get_rules(),
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
on_blast = mesecon.on_blastnode,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_node("mesecons_extrawires:crossover_10", {
|
minetest.register_node("mesecons_extrawires:crossover_10", {
|
||||||
@ -87,6 +89,7 @@ minetest.register_node("mesecons_extrawires:crossover_10", {
|
|||||||
rules = crossover_get_rules(),
|
rules = crossover_get_rules(),
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
on_blast = mesecon.on_blastnode,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_node("mesecons_extrawires:crossover_on", {
|
minetest.register_node("mesecons_extrawires:crossover_on", {
|
||||||
@ -111,6 +114,7 @@ minetest.register_node("mesecons_extrawires:crossover_on", {
|
|||||||
rules = crossover_get_rules(),
|
rules = crossover_get_rules(),
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
on_blast = mesecon.on_blastnode,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
|
@ -26,7 +26,8 @@ local powered_def = mesecon.mergetable(minetest.registered_nodes["default:mese"]
|
|||||||
offstate = "default:mese",
|
offstate = "default:mese",
|
||||||
rules = mesewire_rules
|
rules = mesewire_rules
|
||||||
}},
|
}},
|
||||||
groups = {cracky = 1, not_in_creative_inventory = 1}
|
groups = {cracky = 1, not_in_creative_inventory = 1},
|
||||||
|
on_blast = mesecon.on_blastnode,
|
||||||
})
|
})
|
||||||
|
|
||||||
for i, v in pairs(powered_def.tiles) do
|
for i, v in pairs(powered_def.tiles) do
|
||||||
|
@ -45,7 +45,8 @@ minetest.register_node("mesecons_extrawires:tjunction_on", {
|
|||||||
state = mesecon.state.on,
|
state = mesecon.state.on,
|
||||||
rules = tjunction_get_rules,
|
rules = tjunction_get_rules,
|
||||||
offstate = "mesecons_extrawires:tjunction_off"
|
offstate = "mesecons_extrawires:tjunction_off"
|
||||||
}}
|
}},
|
||||||
|
on_blast = mesecon.on_blastnode,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_node("mesecons_extrawires:tjunction_off", {
|
minetest.register_node("mesecons_extrawires:tjunction_off", {
|
||||||
@ -71,7 +72,8 @@ minetest.register_node("mesecons_extrawires:tjunction_off", {
|
|||||||
state = mesecon.state.off,
|
state = mesecon.state.off,
|
||||||
rules = tjunction_get_rules,
|
rules = tjunction_get_rules,
|
||||||
onstate = "mesecons_extrawires:tjunction_on"
|
onstate = "mesecons_extrawires:tjunction_on"
|
||||||
}}
|
}},
|
||||||
|
on_blast = mesecon.on_blastnode,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
|
@ -116,6 +116,7 @@ plg.register_nodes({
|
|||||||
after_dig_node = function(pos, node)
|
after_dig_node = function(pos, node)
|
||||||
mesecon.receptor_off(pos, plg.rules[node.name])
|
mesecon.receptor_off(pos, plg.rules[node.name])
|
||||||
end,
|
end,
|
||||||
|
on_blast = mesecon.on_blastnode,
|
||||||
on_rotate = function(pos, node, user, mode)
|
on_rotate = function(pos, node, user, mode)
|
||||||
local abcd1 = {"A", "B", "C", "D"}
|
local abcd1 = {"A", "B", "C", "D"}
|
||||||
local abcd2 = {A = 1, B = 2, C = 3, D = 4}
|
local abcd2 = {A = 1, B = 2, C = 3, D = 4}
|
||||||
|
@ -24,7 +24,8 @@ minetest.register_node("mesecons_hydroturbine:hydro_turbine_off", {
|
|||||||
sounds = default.node_sound_stone_defaults(),
|
sounds = default.node_sound_stone_defaults(),
|
||||||
mesecons = {receptor = {
|
mesecons = {receptor = {
|
||||||
state = mesecon.state.off
|
state = mesecon.state.off
|
||||||
}}
|
}},
|
||||||
|
on_blast = mesecon.on_blastnode,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_node("mesecons_hydroturbine:hydro_turbine_on", {
|
minetest.register_node("mesecons_hydroturbine:hydro_turbine_on", {
|
||||||
@ -51,7 +52,8 @@ minetest.register_node("mesecons_hydroturbine:hydro_turbine_on", {
|
|||||||
sounds = default.node_sound_stone_defaults(),
|
sounds = default.node_sound_stone_defaults(),
|
||||||
mesecons = {receptor = {
|
mesecons = {receptor = {
|
||||||
state = mesecon.state.on
|
state = mesecon.state.on
|
||||||
}}
|
}},
|
||||||
|
on_blast = mesecon.on_blastnode,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
@ -36,7 +36,8 @@ minetest.register_node("mesecons_insulated:insulated_on", {
|
|||||||
state = mesecon.state.on,
|
state = mesecon.state.on,
|
||||||
offstate = "mesecons_insulated:insulated_off",
|
offstate = "mesecons_insulated:insulated_off",
|
||||||
rules = insulated_wire_get_rules
|
rules = insulated_wire_get_rules
|
||||||
}}
|
}},
|
||||||
|
on_blast = mesecon.on_blastnode,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_node("mesecons_insulated:insulated_off", {
|
minetest.register_node("mesecons_insulated:insulated_off", {
|
||||||
@ -67,7 +68,8 @@ minetest.register_node("mesecons_insulated:insulated_off", {
|
|||||||
state = mesecon.state.off,
|
state = mesecon.state.off,
|
||||||
onstate = "mesecons_insulated:insulated_on",
|
onstate = "mesecons_insulated:insulated_on",
|
||||||
rules = insulated_wire_get_rules
|
rules = insulated_wire_get_rules
|
||||||
}}
|
}},
|
||||||
|
on_blast = mesecon.on_blastnode,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
|
@ -27,7 +27,8 @@ 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
|
||||||
}}
|
}},
|
||||||
|
on_blast = mesecon.on_blastnode,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_node("mesecons_lamp:lamp_off", {
|
minetest.register_node("mesecons_lamp:lamp_off", {
|
||||||
@ -48,7 +49,8 @@ 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
|
||||||
}}
|
}},
|
||||||
|
on_blast = mesecon.on_blastnode,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
|
@ -20,7 +20,7 @@ function mesecon.lightstone_add(name, base_item, texture_off, texture_on, desc)
|
|||||||
end
|
end
|
||||||
minetest.register_node("mesecons_lightstone:lightstone_" .. name .. "_off", {
|
minetest.register_node("mesecons_lightstone:lightstone_" .. name .. "_off", {
|
||||||
tiles = {texture_off},
|
tiles = {texture_off},
|
||||||
groups = {cracky=2, mesecon_effector_off = 1, mesecon = 2},
|
groups = {cracky = 2, mesecon_effector_off = 1, mesecon = 2},
|
||||||
description = desc,
|
description = desc,
|
||||||
sounds = default.node_sound_stone_defaults(),
|
sounds = default.node_sound_stone_defaults(),
|
||||||
mesecons = {effector = {
|
mesecons = {effector = {
|
||||||
@ -28,20 +28,22 @@ function mesecon.lightstone_add(name, base_item, texture_off, texture_on, desc)
|
|||||||
action_on = function (pos, node)
|
action_on = function (pos, node)
|
||||||
minetest.swap_node(pos, {name = "mesecons_lightstone:lightstone_" .. name .. "_on", param2 = node.param2})
|
minetest.swap_node(pos, {name = "mesecons_lightstone:lightstone_" .. name .. "_on", param2 = node.param2})
|
||||||
end,
|
end,
|
||||||
}}
|
}},
|
||||||
|
on_blast = mesecon.on_blastnode,
|
||||||
})
|
})
|
||||||
minetest.register_node("mesecons_lightstone:lightstone_" .. name .. "_on", {
|
minetest.register_node("mesecons_lightstone:lightstone_" .. name .. "_on", {
|
||||||
tiles = {texture_on},
|
tiles = {texture_on},
|
||||||
groups = {cracky=2,not_in_creative_inventory=1, mesecon = 2},
|
groups = {cracky = 2, not_in_creative_inventory = 1, mesecon = 2},
|
||||||
drop = "mesecons_lightstone:lightstone_" .. name .. "_off",
|
drop = "mesecons_lightstone:lightstone_" .. name .. "_off",
|
||||||
light_source = default.LIGHT_MAX-2,
|
light_source = minetest.LIGHT_MAX - 2,
|
||||||
sounds = default.node_sound_stone_defaults(),
|
sounds = default.node_sound_stone_defaults(),
|
||||||
mesecons = {effector = {
|
mesecons = {effector = {
|
||||||
rules = lightstone_rules,
|
rules = lightstone_rules,
|
||||||
action_off = function (pos, node)
|
action_off = function (pos, node)
|
||||||
minetest.swap_node(pos, {name = "mesecons_lightstone:lightstone_" .. name .. "_off", param2 = node.param2})
|
minetest.swap_node(pos, {name = "mesecons_lightstone:lightstone_" .. name .. "_off", param2 = node.param2})
|
||||||
end,
|
end,
|
||||||
}}
|
}},
|
||||||
|
on_blast = mesecon.on_blastnode,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
|
@ -629,6 +629,7 @@ for d = 0, 1 do
|
|||||||
mesecon.receptor_off(pos, output_rules)
|
mesecon.receptor_off(pos, output_rules)
|
||||||
end,
|
end,
|
||||||
is_luacontroller = true,
|
is_luacontroller = true,
|
||||||
|
on_blast = mesecon.on_blastnode,
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -669,6 +670,7 @@ minetest.register_node(BASENAME .. "_burnt", {
|
|||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
on_blast = mesecon.on_blastnode,
|
||||||
})
|
})
|
||||||
|
|
||||||
------------------------
|
------------------------
|
||||||
|
@ -138,6 +138,7 @@ minetest.register_node(nodename, {
|
|||||||
rules = microc_rules[node.name]
|
rules = microc_rules[node.name]
|
||||||
mesecon.receptor_off(pos, rules)
|
mesecon.receptor_off(pos, rules)
|
||||||
end,
|
end,
|
||||||
|
on_blast = mesecon.on_blastnode,
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -111,6 +111,8 @@ function mesecon.register_movestone(name, def, is_sticky)
|
|||||||
|
|
||||||
def.drop = name
|
def.drop = name
|
||||||
|
|
||||||
|
def.on_blast = mesecon.on_blastnode
|
||||||
|
|
||||||
minetest.register_node(name, def)
|
minetest.register_node(name, def)
|
||||||
|
|
||||||
-- active node only
|
-- active node only
|
||||||
|
@ -12,7 +12,8 @@ minetest.register_node("mesecons_noteblock:noteblock", {
|
|||||||
action_on = function(pos, node)
|
action_on = function(pos, node)
|
||||||
mesecon.noteblock_play(pos, node.param2)
|
mesecon.noteblock_play(pos, node.param2)
|
||||||
end
|
end
|
||||||
}}
|
}},
|
||||||
|
on_blast = mesecon.on_blastnode,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
|
@ -184,7 +184,8 @@ minetest.register_node("mesecons_pistons:piston_normal_off", {
|
|||||||
mesecons = {effector={
|
mesecons = {effector={
|
||||||
action_on = piston_on,
|
action_on = piston_on,
|
||||||
rules = piston_get_rules
|
rules = piston_get_rules
|
||||||
}}
|
}},
|
||||||
|
on_blast = mesecon.on_blastnode,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- onstate
|
-- onstate
|
||||||
@ -212,7 +213,8 @@ minetest.register_node("mesecons_pistons:piston_normal_on", {
|
|||||||
mesecons = {effector={
|
mesecons = {effector={
|
||||||
action_off = piston_off,
|
action_off = piston_off,
|
||||||
rules = piston_get_rules
|
rules = piston_get_rules
|
||||||
}}
|
}},
|
||||||
|
on_blast = mesecon.on_blastnode,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- pusher
|
-- pusher
|
||||||
@ -232,6 +234,7 @@ minetest.register_node("mesecons_pistons:piston_pusher_normal", {
|
|||||||
corresponding_piston = "mesecons_pistons:piston_normal_on",
|
corresponding_piston = "mesecons_pistons:piston_normal_on",
|
||||||
selection_box = piston_pusher_box,
|
selection_box = piston_pusher_box,
|
||||||
node_box = piston_pusher_box,
|
node_box = piston_pusher_box,
|
||||||
|
drop = "",
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Sticky ones
|
-- Sticky ones
|
||||||
@ -265,7 +268,8 @@ minetest.register_node("mesecons_pistons:piston_sticky_off", {
|
|||||||
mesecons = {effector={
|
mesecons = {effector={
|
||||||
action_on = piston_on,
|
action_on = piston_on,
|
||||||
rules = piston_get_rules
|
rules = piston_get_rules
|
||||||
}}
|
}},
|
||||||
|
on_blast = mesecon.on_blastnode,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- onstate
|
-- onstate
|
||||||
@ -293,7 +297,8 @@ minetest.register_node("mesecons_pistons:piston_sticky_on", {
|
|||||||
mesecons = {effector={
|
mesecons = {effector={
|
||||||
action_off = piston_off,
|
action_off = piston_off,
|
||||||
rules = piston_get_rules
|
rules = piston_get_rules
|
||||||
}}
|
}},
|
||||||
|
on_blast = mesecon.on_blastnode,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- pusher
|
-- pusher
|
||||||
@ -313,6 +318,7 @@ minetest.register_node("mesecons_pistons:piston_pusher_sticky", {
|
|||||||
corresponding_piston = "mesecons_pistons:piston_sticky_on",
|
corresponding_piston = "mesecons_pistons:piston_sticky_on",
|
||||||
selection_box = piston_pusher_box,
|
selection_box = piston_pusher_box,
|
||||||
node_box = piston_pusher_box,
|
node_box = piston_pusher_box,
|
||||||
|
drop = "",
|
||||||
})
|
})
|
||||||
|
|
||||||
--
|
--
|
||||||
@ -364,7 +370,8 @@ minetest.register_node("mesecons_pistons:piston_up_normal_off", {
|
|||||||
mesecons = {effector={
|
mesecons = {effector={
|
||||||
action_on = piston_on,
|
action_on = piston_on,
|
||||||
rules = piston_up_rules,
|
rules = piston_up_rules,
|
||||||
}}
|
}},
|
||||||
|
on_blast = mesecon.on_blastnode,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- onstate
|
-- onstate
|
||||||
@ -392,7 +399,8 @@ minetest.register_node("mesecons_pistons:piston_up_normal_on", {
|
|||||||
mesecons = {effector={
|
mesecons = {effector={
|
||||||
action_off = piston_off,
|
action_off = piston_off,
|
||||||
rules = piston_up_rules,
|
rules = piston_up_rules,
|
||||||
}}
|
}},
|
||||||
|
on_blast = mesecon.on_blastnode,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- pusher
|
-- pusher
|
||||||
@ -412,6 +420,7 @@ minetest.register_node("mesecons_pistons:piston_up_pusher_normal", {
|
|||||||
corresponding_piston = "mesecons_pistons:piston_up_normal_on",
|
corresponding_piston = "mesecons_pistons:piston_up_normal_on",
|
||||||
selection_box = piston_up_pusher_box,
|
selection_box = piston_up_pusher_box,
|
||||||
node_box = piston_up_pusher_box,
|
node_box = piston_up_pusher_box,
|
||||||
|
drop = "",
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
@ -448,7 +457,8 @@ minetest.register_node("mesecons_pistons:piston_up_sticky_off", {
|
|||||||
mesecons = {effector={
|
mesecons = {effector={
|
||||||
action_on = piston_on,
|
action_on = piston_on,
|
||||||
rules = piston_up_rules,
|
rules = piston_up_rules,
|
||||||
}}
|
}},
|
||||||
|
on_blast = mesecon.on_blastnode,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- onstate
|
-- onstate
|
||||||
@ -476,7 +486,8 @@ minetest.register_node("mesecons_pistons:piston_up_sticky_on", {
|
|||||||
mesecons = {effector={
|
mesecons = {effector={
|
||||||
action_off = piston_off,
|
action_off = piston_off,
|
||||||
rules = piston_up_rules,
|
rules = piston_up_rules,
|
||||||
}}
|
}},
|
||||||
|
on_blast = mesecon.on_blastnode,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- pusher
|
-- pusher
|
||||||
@ -496,6 +507,7 @@ minetest.register_node("mesecons_pistons:piston_up_pusher_sticky", {
|
|||||||
corresponding_piston = "mesecons_pistons:piston_up_sticky_on",
|
corresponding_piston = "mesecons_pistons:piston_up_sticky_on",
|
||||||
selection_box = piston_up_pusher_box,
|
selection_box = piston_up_pusher_box,
|
||||||
node_box = piston_up_pusher_box,
|
node_box = piston_up_pusher_box,
|
||||||
|
drop = "",
|
||||||
})
|
})
|
||||||
|
|
||||||
--
|
--
|
||||||
@ -550,7 +562,8 @@ minetest.register_node("mesecons_pistons:piston_down_normal_off", {
|
|||||||
mesecons = {effector={
|
mesecons = {effector={
|
||||||
action_on = piston_on,
|
action_on = piston_on,
|
||||||
rules = piston_down_rules,
|
rules = piston_down_rules,
|
||||||
}}
|
}},
|
||||||
|
on_blast = mesecon.on_blastnode,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- onstate
|
-- onstate
|
||||||
@ -578,7 +591,8 @@ minetest.register_node("mesecons_pistons:piston_down_normal_on", {
|
|||||||
mesecons = {effector={
|
mesecons = {effector={
|
||||||
action_off = piston_off,
|
action_off = piston_off,
|
||||||
rules = piston_down_rules,
|
rules = piston_down_rules,
|
||||||
}}
|
}},
|
||||||
|
on_blast = mesecon.on_blastnode,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- pusher
|
-- pusher
|
||||||
@ -598,6 +612,7 @@ minetest.register_node("mesecons_pistons:piston_down_pusher_normal", {
|
|||||||
corresponding_piston = "mesecons_pistons:piston_down_normal_on",
|
corresponding_piston = "mesecons_pistons:piston_down_normal_on",
|
||||||
selection_box = piston_down_pusher_box,
|
selection_box = piston_down_pusher_box,
|
||||||
node_box = piston_down_pusher_box,
|
node_box = piston_down_pusher_box,
|
||||||
|
drop = "",
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Sticky
|
-- Sticky
|
||||||
@ -630,7 +645,8 @@ minetest.register_node("mesecons_pistons:piston_down_sticky_off", {
|
|||||||
mesecons = {effector={
|
mesecons = {effector={
|
||||||
action_on = piston_on,
|
action_on = piston_on,
|
||||||
rules = piston_down_rules,
|
rules = piston_down_rules,
|
||||||
}}
|
}},
|
||||||
|
on_blast = mesecon.on_blastnode,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- onstate
|
-- onstate
|
||||||
@ -658,7 +674,8 @@ minetest.register_node("mesecons_pistons:piston_down_sticky_on", {
|
|||||||
mesecons = {effector={
|
mesecons = {effector={
|
||||||
action_off = piston_off,
|
action_off = piston_off,
|
||||||
rules = piston_down_rules,
|
rules = piston_down_rules,
|
||||||
}}
|
}},
|
||||||
|
on_blast = mesecon.on_blastnode,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- pusher
|
-- pusher
|
||||||
@ -678,6 +695,7 @@ minetest.register_node("mesecons_pistons:piston_down_pusher_sticky", {
|
|||||||
corresponding_piston = "mesecons_pistons:piston_down_sticky_on",
|
corresponding_piston = "mesecons_pistons:piston_down_sticky_on",
|
||||||
selection_box = piston_down_pusher_box,
|
selection_box = piston_down_pusher_box,
|
||||||
node_box = piston_down_pusher_box,
|
node_box = piston_down_pusher_box,
|
||||||
|
drop = "",
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
@ -18,7 +18,8 @@ minetest.register_node("mesecons_powerplant:power_plant", {
|
|||||||
sounds = default.node_sound_leaves_defaults(),
|
sounds = default.node_sound_leaves_defaults(),
|
||||||
mesecons = {receptor = {
|
mesecons = {receptor = {
|
||||||
state = mesecon.state.on
|
state = mesecon.state.on
|
||||||
}}
|
}},
|
||||||
|
on_blast = mesecon.on_blastnode,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
|
@ -12,7 +12,8 @@ minetest.register_node("mesecons_random:removestone", {
|
|||||||
mesecon.on_dignode(pos, node)
|
mesecon.on_dignode(pos, node)
|
||||||
minetest.check_for_falling(vector.add(pos, vector.new(0, 1, 0)))
|
minetest.check_for_falling(vector.add(pos, vector.new(0, 1, 0)))
|
||||||
end
|
end
|
||||||
}}
|
}},
|
||||||
|
on_blast = mesecon.on_blastnode,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
@ -37,7 +38,8 @@ minetest.register_node("mesecons_random:ghoststone", {
|
|||||||
state = mesecon.state.off,
|
state = mesecon.state.off,
|
||||||
rules = mesecon.rules.alldirs,
|
rules = mesecon.rules.alldirs,
|
||||||
onstate = "mesecons_random:ghoststone_active"
|
onstate = "mesecons_random:ghoststone_active"
|
||||||
}}
|
}},
|
||||||
|
on_blast = mesecon.on_blastnode,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_node("mesecons_random:ghoststone_active", {
|
minetest.register_node("mesecons_random:ghoststone_active", {
|
||||||
@ -59,7 +61,8 @@ minetest.register_node("mesecons_random:ghoststone_active", {
|
|||||||
if (minetest.get_node(shadowpos).name == "air") then
|
if (minetest.get_node(shadowpos).name == "air") then
|
||||||
minetest.dig_node(shadowpos)
|
minetest.dig_node(shadowpos)
|
||||||
end
|
end
|
||||||
end
|
end,
|
||||||
|
on_blast = mesecon.on_blastnode,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
@ -25,7 +25,8 @@ minetest.register_node("mesecons_solarpanel:solar_panel_on", {
|
|||||||
sounds = default.node_sound_glass_defaults(),
|
sounds = default.node_sound_glass_defaults(),
|
||||||
mesecons = {receptor = {
|
mesecons = {receptor = {
|
||||||
state = mesecon.state.on
|
state = mesecon.state.on
|
||||||
}}
|
}},
|
||||||
|
on_blast = mesecon.on_blastnode,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Solar Panel
|
-- Solar Panel
|
||||||
@ -55,7 +56,8 @@ minetest.register_node("mesecons_solarpanel:solar_panel_off", {
|
|||||||
sounds = default.node_sound_glass_defaults(),
|
sounds = default.node_sound_glass_defaults(),
|
||||||
mesecons = {receptor = {
|
mesecons = {receptor = {
|
||||||
state = mesecon.state.off
|
state = mesecon.state.off
|
||||||
}}
|
}},
|
||||||
|
on_blast = mesecon.on_blastnode,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
|
@ -62,7 +62,8 @@ minetest.register_node("mesecons_torch:mesecon_torch_off", {
|
|||||||
mesecons = {receptor = {
|
mesecons = {receptor = {
|
||||||
state = mesecon.state.off,
|
state = mesecon.state.off,
|
||||||
rules = torch_get_output_rules
|
rules = torch_get_output_rules
|
||||||
}}
|
}},
|
||||||
|
on_blast = mesecon.on_blastnode,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_node("mesecons_torch:mesecon_torch_on", {
|
minetest.register_node("mesecons_torch:mesecon_torch_on", {
|
||||||
@ -82,6 +83,7 @@ minetest.register_node("mesecons_torch:mesecon_torch_on", {
|
|||||||
state = mesecon.state.on,
|
state = mesecon.state.on,
|
||||||
rules = torch_get_output_rules
|
rules = torch_get_output_rules
|
||||||
}},
|
}},
|
||||||
|
on_blast = mesecon.on_blastnode,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_abm({
|
minetest.register_abm({
|
||||||
|
Loading…
Reference in New Issue
Block a user