From e65c5ca9dc43f09934007fddd89ae81b579bec50 Mon Sep 17 00:00:00 2001 From: Kyle Date: Mon, 3 Sep 2012 11:50:43 -0700 Subject: [PATCH] nodeboxes now show which sides connect --- mesecons_gates/init.lua | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/mesecons_gates/init.lua b/mesecons_gates/init.lua index ac1e4c9..92f0d9a 100644 --- a/mesecons_gates/init.lua +++ b/mesecons_gates/init.lua @@ -8,12 +8,29 @@ for g in ipairs(gates) do gate = gates[g] {x=-1, y=0, z=0}, {x=1, y=0, z=0}, } + node_box = { + type = "fixed", + fixed = { + {-6/16, -8/16, -6/16, 6/16, -7/16, 6/16 }, + {6/16, -8/16, -2/16, 8/16, -7/16, 2/16 }, + {-8/16, -8/16, -2/16, -6/16, -7/16, 2/16 }, + }, + } else rules = { {x=0, y=0, z=1}, {x=0, y=0, z=-1}, {x=1, y=0, z=0}, } + node_box = { + type = "fixed", + fixed = { + {-6/16, -8/16, -6/16, 6/16, -7/16, 6/16 }, + {6/16, -8/16, -2/16, 8/16, -7/16, 2/16 }, + {-2/16, -8/16, 6/16, 2/16, -7/16, 8/16 }, + {-2/16, -8/16, -8/16, 2/16, -7/16, -6/16 }, + }, + } end for on=0,1 do nodename = "mesecons_gates:"..gate @@ -32,11 +49,6 @@ for g in ipairs(gates) do gate = gates[g] --mesecon:add_receptor_node_off(nodename, rules) end - node_box = { - type = "fixed", - fixed = { -8/16, -8/16, -8/16, 8/16, -7/16, 8/16 }, - } - tiles = "jeija_microcontroller_bottom.png^".. "jeija_gate_"..onoff..".png^".. "jeija_gate_"..gate..".png" @@ -88,7 +100,6 @@ end function set_gate(pos, on) gate = get_gate(pos) local meta = minetest.env:get_meta(pos) - local rules = {{x=1, y=0, z=0}} if on ~= gate_state(pos) then yc_heat(meta) minetest.after(0.5, yc_cool, meta) @@ -105,9 +116,9 @@ function set_gate(pos, on) local meta2 = minetest.env:get_meta(pos) meta2:set_int("heat", heat) if on then - mesecon:receptor_on(pos, rules) + mesecon:receptor_on(pos, outrules) else - mesecon:receptor_off(pos, rules) + mesecon:receptor_off(pos, outrules) end end end