summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle <kyle.kylina@gmail.com>2012-09-03 11:50:43 -0700
committerKyle <kyle.kylina@gmail.com>2012-09-03 11:50:43 -0700
commite65c5ca9dc43f09934007fddd89ae81b579bec50 (patch)
tree91ef4bec034ff9f0d5830d7364d7859dda6f3220
parentb0142a7429f4b6e0745290982b3781b5b883530c (diff)
downloadmesecons-e65c5ca9dc43f09934007fddd89ae81b579bec50.tar
mesecons-e65c5ca9dc43f09934007fddd89ae81b579bec50.tar.gz
mesecons-e65c5ca9dc43f09934007fddd89ae81b579bec50.tar.bz2
mesecons-e65c5ca9dc43f09934007fddd89ae81b579bec50.tar.xz
mesecons-e65c5ca9dc43f09934007fddd89ae81b579bec50.zip
nodeboxes now show which sides connect
-rw-r--r--mesecons_gates/init.lua27
1 files 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