Update magic wand
[minetest_hades/hades_revisited.git] / mods / mesecons / mesecons_extrawires / tjunction.lua
blobb9d5cd0e62183c3b02ecd0acbb1f44d7728d120a
1 local tjunction_nodebox = {
2 type = "fixed",
3 fixed = {{ -16/32-0.001, -17/32, -3/32, 16/32+0.001, -13/32, 3/32 },
4 { -3/32, -17/32, -16/32+0.001, 3/32, -13/32, -3/32},}
7 local tjunction_selectionbox = {
8 type = "fixed",
9 fixed = { -16/32-0.001, -18/32, -16/32, 16/32+0.001, -12/32, 7/32 },
12 local tjunction_get_rules = function (node)
13 local rules =
14 {{x = 0, y = 0, z = 1},
15 {x = 1, y = 0, z = 0},
16 {x = 0, y = 0, z = -1}}
18 for i = 0, node.param2 do
19 rules = mesecon:rotate_rules_left(rules)
20 end
22 return rules
23 end
25 minetest.register_node("mesecons_extrawires:tjunction_on", {
26 drawtype = "nodebox",
27 tiles = {
28 "jeija_insulated_wire_tjunction_tb_on.png",
29 "jeija_insulated_wire_tjunction_tb_on.png^[transformR180",
30 "jeija_insulated_wire_ends_on.png",
31 "jeija_insulated_wire_ends_on.png",
32 "jeija_insulated_wire_sides_on.png",
33 "jeija_insulated_wire_ends_on.png"
35 paramtype = "light",
36 paramtype2 = "facedir",
37 walkable = false,
38 sunlight_propagates = true,
39 selection_box = tjunction_selectionbox,
40 node_box = tjunction_nodebox,
41 groups = {dig_immediate = 3, mesecon_conductor_craftable=1, not_in_creative_inventory = 1},
42 drop = "mesecons_extrawires:tjunction_off",
43 mesecons = {conductor =
45 state = mesecon.state.on,
46 rules = tjunction_get_rules,
47 offstate = "mesecons_extrawires:tjunction_off"
51 minetest.register_node("mesecons_extrawires:tjunction_off", {
52 drawtype = "nodebox",
53 description = "Insulated Mesecon T-Junction",
54 tiles = {
55 "jeija_insulated_wire_tjunction_tb_off.png",
56 "jeija_insulated_wire_tjunction_tb_off.png^[transformR180",
57 "jeija_insulated_wire_ends_off.png",
58 "jeija_insulated_wire_ends_off.png",
59 "jeija_insulated_wire_sides_off.png",
60 "jeija_insulated_wire_ends_off.png"
62 paramtype = "light",
63 paramtype2 = "facedir",
64 walkable = false,
65 sunlight_propagates = true,
66 selection_box = tjunction_selectionbox,
67 node_box = tjunction_nodebox,
68 groups = {dig_immediate = 3, mesecon_conductor_craftable=1},
69 mesecons = {conductor =
71 state = mesecon.state.off,
72 rules = tjunction_get_rules,
73 onstate = "mesecons_extrawires:tjunction_on"
77 minetest.register_craft({
78 output = "mesecons_extrawires:tjunction_off 3",
79 recipe = {
80 {"", "", ""},
81 {"mesecons_insulated:insulated_off", "mesecons_insulated:insulated_off", "mesecons_insulated:insulated_off"},
82 {"", "mesecons_insulated:insulated_off", ""},