From 888b0ebfec8c2eff9015163549a7e47443cb8665 Mon Sep 17 00:00:00 2001 From: Vanessa Ezekowitz Date: Fri, 1 Apr 2016 21:00:20 -0400 Subject: "explode" all modpacks into their individual components (you can't have a modpack buried inside a modpack) --- mesecons/mesecons_extrawires/corner.lua | 83 ---------- mesecons/mesecons_extrawires/crossover.lua | 176 -------------------- mesecons/mesecons_extrawires/depends.txt | 2 - .../doc/corner/description.html | 1 - .../mesecons_extrawires/doc/corner/preview.png | Bin 41643 -> 0 bytes mesecons/mesecons_extrawires/doc/corner/recipe.png | Bin 3902 -> 0 bytes .../doc/crossing/description.html | 1 - .../mesecons_extrawires/doc/crossing/preview.png | Bin 62464 -> 0 bytes .../mesecons_extrawires/doc/crossing/recipe.png | Bin 3745 -> 0 bytes .../mesecons_extrawires/doc/mese/description.html | 1 - mesecons/mesecons_extrawires/doc/mese/preview.png | Bin 30599 -> 0 bytes mesecons/mesecons_extrawires/doc/mese/recipe.png | Bin 6266 -> 0 bytes .../doc/tjunction/description.html | 1 - .../mesecons_extrawires/doc/tjunction/preview.png | Bin 55089 -> 0 bytes .../mesecons_extrawires/doc/tjunction/recipe.png | Bin 3946 -> 0 bytes .../doc/vertical/description.html | 1 - .../mesecons_extrawires/doc/vertical/preview.png | Bin 13816 -> 0 bytes .../mesecons_extrawires/doc/vertical/recipe.png | Bin 3059 -> 0 bytes mesecons/mesecons_extrawires/init.lua | 5 - mesecons/mesecons_extrawires/mesewire.lua | 30 ---- mesecons/mesecons_extrawires/tjunction.lua | 84 ---------- mesecons/mesecons_extrawires/vertical.lua | 183 --------------------- 22 files changed, 568 deletions(-) delete mode 100644 mesecons/mesecons_extrawires/corner.lua delete mode 100644 mesecons/mesecons_extrawires/crossover.lua delete mode 100644 mesecons/mesecons_extrawires/depends.txt delete mode 100644 mesecons/mesecons_extrawires/doc/corner/description.html delete mode 100644 mesecons/mesecons_extrawires/doc/corner/preview.png delete mode 100644 mesecons/mesecons_extrawires/doc/corner/recipe.png delete mode 100644 mesecons/mesecons_extrawires/doc/crossing/description.html delete mode 100644 mesecons/mesecons_extrawires/doc/crossing/preview.png delete mode 100644 mesecons/mesecons_extrawires/doc/crossing/recipe.png delete mode 100644 mesecons/mesecons_extrawires/doc/mese/description.html delete mode 100644 mesecons/mesecons_extrawires/doc/mese/preview.png delete mode 100644 mesecons/mesecons_extrawires/doc/mese/recipe.png delete mode 100644 mesecons/mesecons_extrawires/doc/tjunction/description.html delete mode 100644 mesecons/mesecons_extrawires/doc/tjunction/preview.png delete mode 100644 mesecons/mesecons_extrawires/doc/tjunction/recipe.png delete mode 100644 mesecons/mesecons_extrawires/doc/vertical/description.html delete mode 100644 mesecons/mesecons_extrawires/doc/vertical/preview.png delete mode 100644 mesecons/mesecons_extrawires/doc/vertical/recipe.png delete mode 100644 mesecons/mesecons_extrawires/init.lua delete mode 100644 mesecons/mesecons_extrawires/mesewire.lua delete mode 100644 mesecons/mesecons_extrawires/tjunction.lua delete mode 100644 mesecons/mesecons_extrawires/vertical.lua (limited to 'mesecons/mesecons_extrawires') diff --git a/mesecons/mesecons_extrawires/corner.lua b/mesecons/mesecons_extrawires/corner.lua deleted file mode 100644 index 1e29870..0000000 --- a/mesecons/mesecons_extrawires/corner.lua +++ /dev/null @@ -1,83 +0,0 @@ -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:corner_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/mesecons_extrawires/crossover.lua b/mesecons/mesecons_extrawires/crossover.lua deleted file mode 100644 index 4ecfc12..0000000 --- a/mesecons/mesecons_extrawires/crossover.lua +++ /dev/null @@ -1,176 +0,0 @@ -function crossover_get_rules(node) - return { - {--first wire - {x=-1,y=0,z=0}, - {x=1,y=0,z=0}, - }, - {--second wire - {x=0,y=0,z=-1}, - {x=0,y=0,z=1}, - }, - } -end - -local crossover_states = { - "mesecons_extrawires:crossover_off", - "mesecons_extrawires:crossover_01", - "mesecons_extrawires:crossover_10", - "mesecons_extrawires:crossover_on", -} - -minetest.register_node("mesecons_extrawires:crossover_off", { - description = "Insulated Crossover", - drawtype = "nodebox", - tiles = { - "jeija_insulated_wire_crossing_tb_off.png", - "jeija_insulated_wire_crossing_tb_off.png", - "jeija_insulated_wire_ends_off.png" - }, - paramtype = "light", - walkable = false, - stack_max = 99, - selection_box = {type="fixed", fixed={-16/32-0.0001, -18/32, -16/32-0.001, 16/32+0.001, -5/32, 16/32+0.001}}, - node_box = { - type = "fixed", - fixed = { - { -16/32-0.001, -17/32, -3/32, 16/32+0.001, -13/32, 3/32 }, - { -3/32, -17/32, -16/32-0.001, 3/32, -13/32, -6/32 }, - { -3/32, -13/32, -9/32, 3/32, -6/32, -6/32 }, - { -3/32, -9/32, -9/32, 3/32, -6/32, 9/32 }, - { -3/32, -13/32, 6/32, 3/32, -6/32, 9/32 }, - { -3/32, -17/32, 6/32, 3/32, -13/32, 16/32+0.001 }, - }, - }, - groups = {dig_immediate=3, mesecon=3}, - mesecons = { - conductor = { - states = crossover_states, - rules = crossover_get_rules(), - } - }, -}) - -minetest.register_node("mesecons_extrawires:crossover_01", { - description = "You hacker you!", - drop = "mesecons_extrawires:crossover_off", - drawtype = "nodebox", - tiles = { - "jeija_insulated_wire_crossing_tb_01.png", - "jeija_insulated_wire_crossing_tb_01.png", - "jeija_insulated_wire_ends_01x.png", - "jeija_insulated_wire_ends_01x.png", - "jeija_insulated_wire_ends_01z.png", - "jeija_insulated_wire_ends_01z.png" - }, - paramtype = "light", - walkable = false, - stack_max = 99, - selection_box = {type="fixed", fixed={-16/32-0.0001, -18/32, -16/32-0.001, 16/32+0.001, -5/32, 16/32+0.001}}, - node_box = { - type = "fixed", - fixed = { - { -16/32-0.001, -17/32, -3/32, 16/32+0.001, -13/32, 3/32 }, - { -3/32, -17/32, -16/32-0.001, 3/32, -13/32, -6/32 }, - { -3/32, -13/32, -9/32, 3/32, -6/32, -6/32 }, - { -3/32, -9/32, -9/32, 3/32, -6/32, 9/32 }, - { -3/32, -13/32, 6/32, 3/32, -6/32, 9/32 }, - { -3/32, -17/32, 6/32, 3/32, -13/32, 16/32+0.001 }, - }, - }, - groups = {dig_immediate=3, mesecon=3, not_in_creative_inventory=1}, - mesecons = { - conductor = { - states = crossover_states, - rules = crossover_get_rules(), - } - }, -}) - -minetest.register_node("mesecons_extrawires:crossover_10", { - description = "You hacker you!", - drop = "mesecons_extrawires:crossover_off", - drawtype = "nodebox", - tiles = { - "jeija_insulated_wire_crossing_tb_10.png", - "jeija_insulated_wire_crossing_tb_10.png", - "jeija_insulated_wire_ends_10x.png", - "jeija_insulated_wire_ends_10x.png", - "jeija_insulated_wire_ends_10z.png", - "jeija_insulated_wire_ends_10z.png" - }, - paramtype = "light", - walkable = false, - stack_max = 99, - selection_box = {type="fixed", fixed={-16/32-0.0001, -18/32, -16/32-0.001, 16/32+0.001, -5/32, 16/32+0.001}}, - node_box = { - type = "fixed", - fixed = { - { -16/32-0.001, -17/32, -3/32, 16/32+0.001, -13/32, 3/32 }, - { -3/32, -17/32, -16/32-0.001, 3/32, -13/32, -6/32 }, - { -3/32, -13/32, -9/32, 3/32, -6/32, -6/32 }, - { -3/32, -9/32, -9/32, 3/32, -6/32, 9/32 }, - { -3/32, -13/32, 6/32, 3/32, -6/32, 9/32 }, - { -3/32, -17/32, 6/32, 3/32, -13/32, 16/32+0.001 }, - }, - }, - groups = {dig_immediate=3, mesecon=3, not_in_creative_inventory=1}, - mesecons = { - conductor = { - states = crossover_states, - rules = crossover_get_rules(), - } - }, -}) - -minetest.register_node("mesecons_extrawires:crossover_on", { - description = "You hacker you!", - drop = "mesecons_extrawires:crossover_off", - drawtype = "nodebox", - tiles = { - "jeija_insulated_wire_crossing_tb_on.png", - "jeija_insulated_wire_crossing_tb_on.png", - "jeija_insulated_wire_ends_on.png", - "jeija_insulated_wire_ends_on.png", - "jeija_insulated_wire_ends_on.png", - "jeija_insulated_wire_ends_on.png" - }, - paramtype = "light", - walkable = false, - stack_max = 99, - selection_box = {type="fixed", fixed={-16/32-0.0001, -18/32, -16/32-0.001, 16/32+0.001, -5/32, 16/32+0.001}}, - node_box = { - type = "fixed", - fixed = { - { -16/32-0.001, -17/32, -3/32, 16/32+0.001, -13/32, 3/32 }, - { -3/32, -17/32, -16/32-0.001, 3/32, -13/32, -6/32 }, - { -3/32, -13/32, -9/32, 3/32, -6/32, -6/32 }, - { -3/32, -9/32, -9/32, 3/32, -6/32, 9/32 }, - { -3/32, -13/32, 6/32, 3/32, -6/32, 9/32 }, - { -3/32, -17/32, 6/32, 3/32, -13/32, 16/32+0.001 }, - }, - }, - groups = {dig_immediate=3, mesecon=3, not_in_creative_inventory=1}, - mesecons = { - conductor = { - states = crossover_states, - rules = crossover_get_rules(), - } - }, -}) - -minetest.register_craft({ - type = "shapeless", - output = "mesecons_extrawires:crossover_off", - recipe = { - "mesecons_insulated:insulated_off", - "mesecons_insulated:insulated_off", - }, -}) - -minetest.register_craft({ - type = "shapeless", - output = "mesecons_insulated:insulated_off 2", - recipe = { - "mesecons_extrawires:crossover_off", - }, -}) diff --git a/mesecons/mesecons_extrawires/depends.txt b/mesecons/mesecons_extrawires/depends.txt deleted file mode 100644 index aca967d..0000000 --- a/mesecons/mesecons_extrawires/depends.txt +++ /dev/null @@ -1,2 +0,0 @@ -default -mesecons diff --git a/mesecons/mesecons_extrawires/doc/corner/description.html b/mesecons/mesecons_extrawires/doc/corner/description.html deleted file mode 100644 index 92de8b0..0000000 --- a/mesecons/mesecons_extrawires/doc/corner/description.html +++ /dev/null @@ -1 +0,0 @@ -Insulated corners are conductors that only conduct between the inputs (also not up or down). When placing they always point to the left in direction of your vision. diff --git a/mesecons/mesecons_extrawires/doc/corner/preview.png b/mesecons/mesecons_extrawires/doc/corner/preview.png deleted file mode 100644 index 9713229..0000000 Binary files a/mesecons/mesecons_extrawires/doc/corner/preview.png and /dev/null differ diff --git a/mesecons/mesecons_extrawires/doc/corner/recipe.png b/mesecons/mesecons_extrawires/doc/corner/recipe.png deleted file mode 100644 index ac85b01..0000000 Binary files a/mesecons/mesecons_extrawires/doc/corner/recipe.png and /dev/null differ diff --git a/mesecons/mesecons_extrawires/doc/crossing/description.html b/mesecons/mesecons_extrawires/doc/crossing/description.html deleted file mode 100644 index aa4cf25..0000000 --- a/mesecons/mesecons_extrawires/doc/crossing/description.html +++ /dev/null @@ -1 +0,0 @@ -Insulated crossing are conductors that conduct two signals between the opposing sides, the signals are insulated to each other. diff --git a/mesecons/mesecons_extrawires/doc/crossing/preview.png b/mesecons/mesecons_extrawires/doc/crossing/preview.png deleted file mode 100644 index 66aaa05..0000000 Binary files a/mesecons/mesecons_extrawires/doc/crossing/preview.png and /dev/null differ diff --git a/mesecons/mesecons_extrawires/doc/crossing/recipe.png b/mesecons/mesecons_extrawires/doc/crossing/recipe.png deleted file mode 100644 index ac37401..0000000 Binary files a/mesecons/mesecons_extrawires/doc/crossing/recipe.png and /dev/null differ diff --git a/mesecons/mesecons_extrawires/doc/mese/description.html b/mesecons/mesecons_extrawires/doc/mese/description.html deleted file mode 100644 index 1a14864..0000000 --- a/mesecons/mesecons_extrawires/doc/mese/description.html +++ /dev/null @@ -1 +0,0 @@ -The basic prerequesite for mesecons, can be crafted into wires and other stuff. Have a look at the Minetest Wiki for more information. Mese is a conductor. It conducts in all six directions: Up/Down/Left/Right/Forward/Backward diff --git a/mesecons/mesecons_extrawires/doc/mese/preview.png b/mesecons/mesecons_extrawires/doc/mese/preview.png deleted file mode 100644 index 3ce0ea4..0000000 Binary files a/mesecons/mesecons_extrawires/doc/mese/preview.png and /dev/null differ diff --git a/mesecons/mesecons_extrawires/doc/mese/recipe.png b/mesecons/mesecons_extrawires/doc/mese/recipe.png deleted file mode 100644 index 904cf0b..0000000 Binary files a/mesecons/mesecons_extrawires/doc/mese/recipe.png and /dev/null differ diff --git a/mesecons/mesecons_extrawires/doc/tjunction/description.html b/mesecons/mesecons_extrawires/doc/tjunction/description.html deleted file mode 100644 index f655a5d..0000000 --- a/mesecons/mesecons_extrawires/doc/tjunction/description.html +++ /dev/null @@ -1 +0,0 @@ -Insulated T-Junctions are conductors that only conduct between the inputs (also not up or down). diff --git a/mesecons/mesecons_extrawires/doc/tjunction/preview.png b/mesecons/mesecons_extrawires/doc/tjunction/preview.png deleted file mode 100644 index 4dec841..0000000 Binary files a/mesecons/mesecons_extrawires/doc/tjunction/preview.png and /dev/null differ diff --git a/mesecons/mesecons_extrawires/doc/tjunction/recipe.png b/mesecons/mesecons_extrawires/doc/tjunction/recipe.png deleted file mode 100644 index 8602941..0000000 Binary files a/mesecons/mesecons_extrawires/doc/tjunction/recipe.png and /dev/null differ diff --git a/mesecons/mesecons_extrawires/doc/vertical/description.html b/mesecons/mesecons_extrawires/doc/vertical/description.html deleted file mode 100644 index df09b94..0000000 --- a/mesecons/mesecons_extrawires/doc/vertical/description.html +++ /dev/null @@ -1 +0,0 @@ -Vertical Mesecons only conduct up and down. Plates appear at the ends, at that place they also conduct to the side. diff --git a/mesecons/mesecons_extrawires/doc/vertical/preview.png b/mesecons/mesecons_extrawires/doc/vertical/preview.png deleted file mode 100644 index aad6ea8..0000000 Binary files a/mesecons/mesecons_extrawires/doc/vertical/preview.png and /dev/null differ diff --git a/mesecons/mesecons_extrawires/doc/vertical/recipe.png b/mesecons/mesecons_extrawires/doc/vertical/recipe.png deleted file mode 100644 index 83bc498..0000000 Binary files a/mesecons/mesecons_extrawires/doc/vertical/recipe.png and /dev/null differ diff --git a/mesecons/mesecons_extrawires/init.lua b/mesecons/mesecons_extrawires/init.lua deleted file mode 100644 index b22f2e5..0000000 --- a/mesecons/mesecons_extrawires/init.lua +++ /dev/null @@ -1,5 +0,0 @@ -dofile(minetest.get_modpath("mesecons_extrawires").."/crossover.lua"); -dofile(minetest.get_modpath("mesecons_extrawires").."/tjunction.lua"); -dofile(minetest.get_modpath("mesecons_extrawires").."/corner.lua"); -dofile(minetest.get_modpath("mesecons_extrawires").."/vertical.lua"); -dofile(minetest.get_modpath("mesecons_extrawires").."/mesewire.lua"); diff --git a/mesecons/mesecons_extrawires/mesewire.lua b/mesecons/mesecons_extrawires/mesewire.lua deleted file mode 100644 index 150178c..0000000 --- a/mesecons/mesecons_extrawires/mesewire.lua +++ /dev/null @@ -1,30 +0,0 @@ -local mesewire_rules = -{ - {x = 1, y = 0, z = 0}, - {x =-1, y = 0, z = 0}, - {x = 0, y = 1, z = 0}, - {x = 0, y =-1, z = 0}, - {x = 0, y = 0, z = 1}, - {x = 0, y = 0, z =-1}, -} - -minetest.override_item("default:mese", { - mesecons = {conductor = { - state = mesecon.state.off, - onstate = "mesecons_extrawires:mese_powered", - rules = mesewire_rules - }} -}) - -minetest.register_node("mesecons_extrawires:mese_powered", { - tiles = {minetest.registered_nodes["default:mese"].tiles[1].."^[brighten"}, - is_ground_content = true, - groups = {cracky=1, not_in_creative_inventory = 1}, - sounds = default.node_sound_stone_defaults(), - mesecons = {conductor = { - state = mesecon.state.on, - offstate = "default:mese", - rules = mesewire_rules - }}, - drop = "default:mese" -}) diff --git a/mesecons/mesecons_extrawires/tjunction.lua b/mesecons/mesecons_extrawires/tjunction.lua deleted file mode 100644 index 1091e83..0000000 --- a/mesecons/mesecons_extrawires/tjunction.lua +++ /dev/null @@ -1,84 +0,0 @@ -local tjunction_nodebox = { - type = "fixed", - fixed = {{ -16/32-0.001, -17/32, -3/32, 16/32+0.001, -13/32, 3/32 }, - { -3/32, -17/32, -16/32+0.001, 3/32, -13/32, -3/32},} -} - -local tjunction_selectionbox = { - type = "fixed", - fixed = { -16/32-0.001, -18/32, -16/32, 16/32+0.001, -12/32, 7/32 }, -} - -local tjunction_get_rules = function (node) - local rules = - {{x = 0, y = 0, z = 1}, - {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:tjunction_on", { - drawtype = "nodebox", - tiles = { - "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_on.png", - "jeija_insulated_wire_ends_on.png" - }, - paramtype = "light", - paramtype2 = "facedir", - walkable = false, - sunlight_propagates = true, - selection_box = tjunction_selectionbox, - node_box = tjunction_nodebox, - groups = {dig_immediate = 3, not_in_creative_inventory = 1}, - drop = "mesecons_extrawires:tjunction_off", - mesecons = {conductor = - { - state = mesecon.state.on, - rules = tjunction_get_rules, - offstate = "mesecons_extrawires:tjunction_off" - }} -}) - -minetest.register_node("mesecons_extrawires:tjunction_off", { - drawtype = "nodebox", - description = "T-junction", - tiles = { - "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_off.png", - "jeija_insulated_wire_ends_off.png" - }, - paramtype = "light", - paramtype2 = "facedir", - walkable = false, - sunlight_propagates = true, - selection_box = tjunction_selectionbox, - node_box = tjunction_nodebox, - groups = {dig_immediate = 3}, - mesecons = {conductor = - { - state = mesecon.state.off, - rules = tjunction_get_rules, - onstate = "mesecons_extrawires:tjunction_on" - }} -}) - -minetest.register_craft({ - output = "mesecons_extrawires:tjunction_off 3", - recipe = { - {"", "", ""}, - {"mesecons_insulated:insulated_off", "mesecons_insulated:insulated_off", "mesecons_insulated:insulated_off"}, - {"", "mesecons_insulated:insulated_off", ""}, - } -}) diff --git a/mesecons/mesecons_extrawires/vertical.lua b/mesecons/mesecons_extrawires/vertical.lua deleted file mode 100644 index cac2ae2..0000000 --- a/mesecons/mesecons_extrawires/vertical.lua +++ /dev/null @@ -1,183 +0,0 @@ -local vertical_box = { - type = "fixed", - fixed = {-1/16, -8/16, -1/16, 1/16, 8/16, 1/16} -} - -local top_box = { - type = "fixed", - fixed = {{-8/16, -8/16, -8/16, 8/16, -7/16, 8/16}} -} - -local bottom_box = { - type = "fixed", - fixed = { - {-8/16, -8/16, -8/16, 8/16, -7/16, 8/16}, - {-1/16, -7/16, -1/16, 1/16, 8/16, 1/16}, - } -} - -local vertical_rules = { - {x=0, y=1, z=0}, - {x=0, y=-1, z=0} -} - -local top_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=0,y=-1, z=0} -} - -local bottom_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=0, y=1, z=0}, - {x=0, y=2, z=0} -- receive power from pressure plate / detector / ... 2 nodes above -} - -local vertical_updatepos = function (pos) - local node = minetest.get_node(pos) - if minetest.registered_nodes[node.name] - and minetest.registered_nodes[node.name].is_vertical_conductor then - local node_above = minetest.get_node(mesecon.addPosRule(pos, vertical_rules[1])) - local node_below = minetest.get_node(mesecon.addPosRule(pos, vertical_rules[2])) - local namestate = minetest.registered_nodes[node.name].vertical_conductor_state - - local above = minetest.registered_nodes[node_above.name] - and minetest.registered_nodes[node_above.name].is_vertical_conductor - local below = minetest.registered_nodes[node_below.name] - and minetest.registered_nodes[node_below.name].is_vertical_conductor - - local basename = "mesecons_extrawires:vertical_" - if above and below then -- above and below: vertical mesecon - minetest.add_node(pos, {name = basename .. namestate}) - elseif above and not below then -- above only: bottom - minetest.add_node(pos, {name = basename .. "bottom_" .. namestate}) - elseif not above and below then -- below only: top - minetest.add_node(pos, {name = basename .. "top_" .. namestate}) - else -- no vertical wire above, no vertical wire below: use bottom - minetest.add_node(pos, {name = basename .. "bottom_" .. namestate}) - end - mesecon.update_autoconnect(pos) - end -end - -local vertical_update = function (pos, node) - vertical_updatepos(pos) -- this one - vertical_updatepos(mesecon.addPosRule(pos, vertical_rules[1])) -- above - vertical_updatepos(mesecon.addPosRule(pos, vertical_rules[2])) -- below -end - --- Vertical wire -mesecon.register_node("mesecons_extrawires:vertical", { - description = "Vertical mesecon", - drawtype = "nodebox", - walkable = false, - paramtype = "light", - sunlight_propagates = true, - selection_box = vertical_box, - node_box = vertical_box, - is_vertical_conductor = true, - drop = "mesecons_extrawires:vertical_off", - after_place_node = vertical_update, - after_dig_node = vertical_update -},{ - tiles = {"mesecons_wire_off.png"}, - groups = {dig_immediate=3}, - vertical_conductor_state = "off", - mesecons = {conductor = { - state = mesecon.state.off, - onstate = "mesecons_extrawires:vertical_on", - rules = vertical_rules, - }} -},{ - tiles = {"mesecons_wire_on.png"}, - groups = {dig_immediate=3, not_in_creative_inventory=1}, - vertical_conductor_state = "on", - mesecons = {conductor = { - state = mesecon.state.on, - offstate = "mesecons_extrawires:vertical_off", - rules = vertical_rules, - }} -}) - --- Vertical wire top -mesecon.register_node("mesecons_extrawires:vertical_top", { - description = "Vertical mesecon", - drawtype = "nodebox", - walkable = false, - paramtype = "light", - sunlight_propagates = true, - groups = {dig_immediate=3, not_in_creative_inventory=1}, - selection_box = top_box, - node_box = top_box, - is_vertical_conductor = true, - drop = "mesecons_extrawires:vertical_off", - after_place_node = vertical_update, - after_dig_node = vertical_update -},{ - tiles = {"mesecons_wire_off.png"}, - vertical_conductor_state = "off", - mesecons = {conductor = { - state = mesecon.state.off, - onstate = "mesecons_extrawires:vertical_top_on", - rules = top_rules, - }} -},{ - tiles = {"mesecons_wire_on.png"}, - vertical_conductor_state = "on", - mesecons = {conductor = { - state = mesecon.state.on, - offstate = "mesecons_extrawires:vertical_top_off", - rules = top_rules, - }} -}) - --- Vertical wire bottom -mesecon.register_node("mesecons_extrawires:vertical_bottom", { - description = "Vertical mesecon", - drawtype = "nodebox", - walkable = false, - paramtype = "light", - sunlight_propagates = true, - groups = {dig_immediate = 3, not_in_creative_inventory = 1}, - selection_box = bottom_box, - node_box = bottom_box, - is_vertical_conductor = true, - drop = "mesecons_extrawires:vertical_off", - after_place_node = vertical_update, - after_dig_node = vertical_update -},{ - tiles = {"mesecons_wire_off.png"}, - vertical_conductor_state = "off", - mesecons = {conductor = { - state = mesecon.state.off, - onstate = "mesecons_extrawires:vertical_bottom_on", - rules = bottom_rules, - }} -},{ - tiles = {"mesecons_wire_on.png"}, - vertical_conductor_state = "on", - mesecons = {conductor = { - state = mesecon.state.on, - offstate = "mesecons_extrawires:vertical_bottom_off", - rules = bottom_rules, - }} -}) - -minetest.register_craft({ - output = "mesecons_extrawires:vertical_off 3", - recipe = { - {"mesecons:wire_00000000_off"}, - {"mesecons:wire_00000000_off"}, - {"mesecons:wire_00000000_off"} - } -}) - -minetest.register_craft({ - output = "mesecons:wire_00000000_off", - recipe = {{"mesecons_extrawires:vertical_off"}} -}) -- cgit v1.2.3