mirror of
https://github.com/minetest-mods/mesecons.git
synced 2024-12-25 09:50:19 +01:00
registering the on receptor makes placing a mesecon on the out port of
the gate update the circuitry after it
This commit is contained in:
parent
0f7a87538d
commit
845c275121
@ -1,3 +1,6 @@
|
|||||||
|
outrules = {
|
||||||
|
{x=1, y=0, z=0},
|
||||||
|
}
|
||||||
gates = {"diode", "not", "nand", "and", "xor"}
|
gates = {"diode", "not", "nand", "and", "xor"}
|
||||||
for g in ipairs(gates) do gate = gates[g]
|
for g in ipairs(gates) do gate = gates[g]
|
||||||
if g < 3 then
|
if g < 3 then
|
||||||
@ -13,20 +16,22 @@ for g in ipairs(gates) do gate = gates[g]
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
for on=0,1 do
|
for on=0,1 do
|
||||||
|
nodename = "mesecons_gates:"..gate
|
||||||
if on == 1 then
|
if on == 1 then
|
||||||
onoff = "on"
|
onoff = "on"
|
||||||
|
drop = nodename.."_off"
|
||||||
groups = {dig_immediate=2, not_in_creative_inventory=1, mesecon = 3}
|
groups = {dig_immediate=2, not_in_creative_inventory=1, mesecon = 3}
|
||||||
drop = "mesecons_gates:"..gate.."_off"
|
|
||||||
description = "You hacker you!"
|
description = "You hacker you!"
|
||||||
|
nodename = nodename.."_"..onoff
|
||||||
|
mesecon:add_receptor_node(nodename, outrules)
|
||||||
else
|
else
|
||||||
onoff = "off"
|
onoff = "off"
|
||||||
groups = {dig_immediate=2, mesecon = 3}
|
groups = {dig_immediate=2, mesecon = 3}
|
||||||
drop = nodename
|
|
||||||
description = gate.." Gate"
|
description = gate.." Gate"
|
||||||
|
nodename = nodename.."_"..onoff
|
||||||
|
--mesecon:add_receptor_node_off(nodename, rules)
|
||||||
end
|
end
|
||||||
|
|
||||||
nodename = "mesecons_gates:"..gate.."_"..onoff
|
|
||||||
|
|
||||||
node_box = {
|
node_box = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
fixed = { -8/16, -8/16, -8/16, 8/16, -7/16, 8/16 },
|
fixed = { -8/16, -8/16, -8/16, 8/16, -7/16, 8/16 },
|
||||||
|
Loading…
Reference in New Issue
Block a user