diff options
-rw-r--r-- | mesecons_extrawires/corner.lua | 2 | ||||
-rw-r--r-- | mesecons_extrawires/init.lua | 1 | ||||
-rw-r--r-- | mesecons_extrawires/mesewire.lua | 35 |
3 files changed, 37 insertions, 1 deletions
diff --git a/mesecons_extrawires/corner.lua b/mesecons_extrawires/corner.lua index df45d41..320745e 100644 --- a/mesecons_extrawires/corner.lua +++ b/mesecons_extrawires/corner.lua @@ -38,7 +38,7 @@ minetest.register_node("mesecons_extrawires:corner_on", { selection_box = corner_selectionbox, node_box = corner_nodebox, groups = {dig_immediate = 3, not_in_creative_inventory = 1}, - drop = "mesecons_extrawires:insulated_off", + drop = "mesecons_extrawires:corner_off", mesecons = {conductor = { state = mesecon.state.on, diff --git a/mesecons_extrawires/init.lua b/mesecons_extrawires/init.lua index ec51a93..c076e3d 100644 --- a/mesecons_extrawires/init.lua +++ b/mesecons_extrawires/init.lua @@ -3,3 +3,4 @@ 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_extrawires/mesewire.lua b/mesecons_extrawires/mesewire.lua new file mode 100644 index 0000000..cf796ad --- /dev/null +++ b/mesecons_extrawires/mesewire.lua @@ -0,0 +1,35 @@ +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.register_node(":default:mese", { + description = "Mese Block", + tiles = {"default_mese_block.png"}, + is_ground_content = true, + groups = {cracky=1}, + sounds = default.node_sound_stone_defaults(), + mesecons = {conductor = { + state = mesecon.state.off, + onstate = "mesecons_extrawires:mese_powered", + rules = mesewire_rules + }} +}) + +minetest.register_node("mesecons_extrawires:mese_powered", { + tiles = {"default_mese_block.png^[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" +}) |