summaryrefslogtreecommitdiff
path: root/mesecons_extrawires
diff options
context:
space:
mode:
Diffstat (limited to 'mesecons_extrawires')
-rw-r--r--mesecons_extrawires/corner.lua83
-rw-r--r--mesecons_extrawires/crossing.lua2
-rw-r--r--mesecons_extrawires/init.lua1
-rw-r--r--mesecons_extrawires/tjunction.lua27
-rw-r--r--mesecons_extrawires/vertical.lua18
5 files changed, 106 insertions, 25 deletions
diff --git a/mesecons_extrawires/corner.lua b/mesecons_extrawires/corner.lua
new file mode 100644
index 0000000..df45d41
--- /dev/null
+++ b/mesecons_extrawires/corner.lua
@@ -0,0 +1,83 @@
+local corner_nodebox = {
+ type = "fixed",
+ fixed = {{ -16/32-0.001, -17/32, -3/32, 0, -13/32, 3/32 },
+ { -3/32, -17/32, -16/32+0.001, 3/32, -13/32, 3/32}}
+}
+
+local corner_selectionbox = {
+ type = "fixed",
+ fixed = { -16/32-0.001, -18/32, -16/32, 5/32, -12/32, 5/32 },
+}
+
+local corner_get_rules = function (node)
+ local rules =
+ {{x = 1, y = 0, z = 0},
+ {x = 0, y = 0, z = -1}}
+
+ for i = 0, node.param2 do
+ rules = mesecon:rotate_rules_left(rules)
+ end
+
+ return rules
+end
+
+minetest.register_node("mesecons_extrawires:corner_on", {
+ drawtype = "nodebox",
+ tiles = {
+ "jeija_insulated_wire_curved_tb_on.png",
+ "jeija_insulated_wire_curved_tb_on.png^[transformR270",
+ "jeija_insulated_wire_sides_on.png",
+ "jeija_insulated_wire_ends_on.png",
+ "jeija_insulated_wire_sides_on.png",
+ "jeija_insulated_wire_ends_on.png"
+ },
+ paramtype = "light",
+ paramtype2 = "facedir",
+ walkable = false,
+ sunlight_propagates = true,
+ selection_box = corner_selectionbox,
+ node_box = corner_nodebox,
+ groups = {dig_immediate = 3, not_in_creative_inventory = 1},
+ drop = "mesecons_extrawires:insulated_off",
+ mesecons = {conductor =
+ {
+ state = mesecon.state.on,
+ rules = corner_get_rules,
+ offstate = "mesecons_extrawires:corner_off"
+ }}
+})
+
+minetest.register_node("mesecons_extrawires:corner_off", {
+ drawtype = "nodebox",
+ description = "Mesecon Corner",
+ tiles = {
+ "jeija_insulated_wire_curved_tb_off.png",
+ "jeija_insulated_wire_curved_tb_off.png^[transformR270",
+ "jeija_insulated_wire_sides_off.png",
+ "jeija_insulated_wire_ends_off.png",
+ "jeija_insulated_wire_sides_off.png",
+ "jeija_insulated_wire_ends_off.png"
+ },
+ paramtype = "light",
+ paramtype2 = "facedir",
+ walkable = false,
+ sunlight_propagates = true,
+ selection_box = corner_selectionbox,
+ node_box = corner_nodebox,
+ groups = {dig_immediate = 3},
+ mesecons = {conductor =
+ {
+ state = mesecon.state.off,
+ rules = corner_get_rules,
+ onstate = "mesecons_extrawires:corner_on"
+ }}
+})
+
+minetest.register_craft({
+ output = '"mesecons_extrawires:corner_off" 3',
+ recipe = {
+ {"", "", ""},
+ {"mesecons_insulated:insulated_off", "mesecons_insulated:insulated_off", ""},
+ {"", "mesecons_insulated:insulated_off", ""},
+ }
+})
diff --git a/mesecons_extrawires/crossing.lua b/mesecons_extrawires/crossing.lua
index 2b35af1..9b381bf 100644
--- a/mesecons_extrawires/crossing.lua
+++ b/mesecons_extrawires/crossing.lua
@@ -6,7 +6,7 @@ end
minetest.register_node("mesecons_extrawires:crossing_on", {
drawtype = "nodebox",
- tiles = {"jeija_insulated_wire_sides.png"},
+ tiles = {"jeija_insulated_wire_sides_on.png"},
paramtype = "light",
walkable = false,
stack_max = 99,
diff --git a/mesecons_extrawires/init.lua b/mesecons_extrawires/init.lua
index 31dfcd2..ec51a93 100644
--- a/mesecons_extrawires/init.lua
+++ b/mesecons_extrawires/init.lua
@@ -1,4 +1,5 @@
-- dofile(minetest.get_modpath("mesecons_extrawires").."/crossing.lua");
-- The crossing code is not active right now because it is hard to maintain
dofile(minetest.get_modpath("mesecons_extrawires").."/tjunction.lua");
+dofile(minetest.get_modpath("mesecons_extrawires").."/corner.lua");
dofile(minetest.get_modpath("mesecons_extrawires").."/vertical.lua");
diff --git a/mesecons_extrawires/tjunction.lua b/mesecons_extrawires/tjunction.lua
index cb16cfb..5146b0c 100644
--- a/mesecons_extrawires/tjunction.lua
+++ b/mesecons_extrawires/tjunction.lua
@@ -11,28 +11,25 @@ local tjunction_selectionbox = {
local tjunction_get_rules = function (node)
local rules =
- {{x = 1, y = 0, z = 0},
- {x =-1, y = 0, z = 0},
- {x = 0, y = 0, z = -1}}
+ {{x = 0, y = 0, z = 1},
+ {x = 1, y = 0, z = 0},
+ {x = 0, y = 0, z = -1}}
- if node.param2 == 1 then
+ for i = 0, node.param2 do
rules = mesecon:rotate_rules_left(rules)
- elseif node.param2 == 2 then
- rules = mesecon:rotate_rules_right(mesecon:rotate_rules_right(rules))
- elseif node.param2 == 3 then
- rules = mesecon:rotate_rules_right(rules)
end
+
return rules
end
minetest.register_node("mesecons_extrawires:tjunction_on", {
drawtype = "nodebox",
tiles = {
- "jeija_insulated_wire_sides.png",
- "jeija_insulated_wire_sides.png",
+ "jeija_insulated_wire_tjunction_tb_on.png",
+ "jeija_insulated_wire_tjunction_tb_on.png^[transformR180",
"jeija_insulated_wire_ends_on.png",
"jeija_insulated_wire_ends_on.png",
- "jeija_insulated_wire_sides.png",
+ "jeija_insulated_wire_sides_on.png",
"jeija_insulated_wire_ends_on.png"
},
paramtype = "light",
@@ -42,7 +39,7 @@ minetest.register_node("mesecons_extrawires:tjunction_on", {
selection_box = tjunction_selectionbox,
node_box = tjunction_nodebox,
groups = {dig_immediate = 3, mesecon_conductor_craftable=1, not_in_creative_inventory = 1},
- drop = "mesecons_insulated:insulated_off",
+ drop = "mesecons_extrawires:tjunction_off",
mesecons = {conductor =
{
state = mesecon.state.on,
@@ -55,11 +52,11 @@ minetest.register_node("mesecons_extrawires:tjunction_off", {
drawtype = "nodebox",
description = "T-junction",
tiles = {
- "jeija_insulated_wire_sides.png",
- "jeija_insulated_wire_sides.png",
+ "jeija_insulated_wire_tjunction_tb_off.png",
+ "jeija_insulated_wire_tjunction_tb_off.png^[transformR180",
"jeija_insulated_wire_ends_off.png",
"jeija_insulated_wire_ends_off.png",
- "jeija_insulated_wire_sides.png",
+ "jeija_insulated_wire_sides_off.png",
"jeija_insulated_wire_ends_off.png"
},
paramtype = "light",
diff --git a/mesecons_extrawires/vertical.lua b/mesecons_extrawires/vertical.lua
index 9aaa163..b21ccb7 100644
--- a/mesecons_extrawires/vertical.lua
+++ b/mesecons_extrawires/vertical.lua
@@ -77,7 +77,7 @@ minetest.register_node("mesecons_extrawires:vertical_on", {
walkable = false,
paramtype = "light",
sunlight_propagates = true,
- groups = {dig_immediate = 3},
+ groups = {dig_immediate = 3, not_in_creative_inventory = 1},
selection_box = vbox,
node_box = vbox,
is_vertical_conductor = true,
@@ -117,11 +117,11 @@ minetest.register_node("mesecons_extrawires:vertical_off", {
minetest.register_node("mesecons_extrawires:vertical_top_on", {
description = "Vertical mesecon",
drawtype = "nodebox",
- tiles = {"wires_vertical_on.png"},
+ tiles = {"wires_full_on.png"},
walkable = false,
paramtype = "light",
sunlight_propagates = true,
- groups = {dig_immediate = 3},
+ groups = {dig_immediate = 3, not_in_creative_inventory = 1},
selection_box = tbox,
node_box = tbox,
is_vertical_conductor = true,
@@ -139,11 +139,11 @@ minetest.register_node("mesecons_extrawires:vertical_top_on", {
minetest.register_node("mesecons_extrawires:vertical_top_off", {
description = "Vertical mesecon",
drawtype = "nodebox",
- tiles = {"wires_vertical_off.png"},
+ tiles = {"wires_full_off.png"},
walkable = false,
paramtype = "light",
sunlight_propagates = true,
- groups = {dig_immediate = 3},
+ groups = {dig_immediate = 3, not_in_creative_inventory = 1},
selection_box = tbox,
node_box = tbox,
is_vertical_conductor = true,
@@ -162,12 +162,12 @@ minetest.register_node("mesecons_extrawires:vertical_top_off", {
minetest.register_node("mesecons_extrawires:vertical_bottom_on", {
description = "Vertical mesecon",
drawtype = "nodebox",
- tiles = {"wires_vertical_on.png"},
+ tiles = {"wires_full_on.png"},
walkable = false,
paramtype = "light",
sunlight_propagates = true,
vertical_conductor_state = "on",
- groups = {dig_immediate = 3},
+ groups = {dig_immediate = 3, not_in_creative_inventory = 1},
selection_box = bbox,
node_box = bbox,
mesecons = {conductor = {
@@ -183,11 +183,11 @@ minetest.register_node("mesecons_extrawires:vertical_bottom_on", {
minetest.register_node("mesecons_extrawires:vertical_bottom_off", {
description = "Vertical mesecon",
drawtype = "nodebox",
- tiles = {"wires_vertical_off.png"},
+ tiles = {"wires_full_off.png"},
walkable = false,
paramtype = "light",
sunlight_propagates = true,
- groups = {dig_immediate = 3},
+ groups = {dig_immediate = 3, not_in_creative_inventory = 1},
selection_box = bbox,
node_box = bbox,
is_vertical_conductor = true,