From ad5cc7990242e94ee2fd9678d9e88e7d87e9bfb8 Mon Sep 17 00:00:00 2001 From: rdococ Date: Thu, 10 Aug 2017 23:40:03 +0100 Subject: [PATCH] Mesegrates now conduct mesecon signal. Still trying to work out a few kinks in the grate's mechanics. Also, added description.txt, mod.conf. --- description.txt | 1 + grate.lua | 2 +- mesegrate.lua | 34 ++++++++++++++++++++++++---------- mod.conf | 1 + 4 files changed, 27 insertions(+), 11 deletions(-) create mode 100644 description.txt create mode 100644 mod.conf diff --git a/description.txt b/description.txt new file mode 100644 index 0000000..777a6a2 --- /dev/null +++ b/description.txt @@ -0,0 +1 @@ +Multipurpose mod with conveyors, grates, crates and programming blocks. diff --git a/grate.lua b/grate.lua index ba7686f..0c38205 100644 --- a/grate.lua +++ b/grate.lua @@ -59,7 +59,7 @@ local function attempt_flow_to(pos1, pos2, dec) elseif pos2.y > pos1.y then return end local new_level = level1 - dec - if gravity then new_level = 8 end + if gravity then new_level = 15 end -- When water flows normally, it slowly decreases as it spreads outwards. -- Dec is the variable applied to the originating liquid's level, which diff --git a/mesegrate.lua b/mesegrate.lua index cfb1833..3e1c38a 100644 --- a/mesegrate.lua +++ b/mesegrate.lua @@ -5,11 +5,18 @@ minetest.register_node("rmod:mesegrate_off", { use_texture_alpha = true, --drawtype = "glasslike", paramtype = "light", - mesecons = {effector = { - action_on = function (pos, node) - minetest.swap_node(pos, {name = "rmod:mesegrate_on", param2 = node.param2}) - end, - }} + mesecons = { + conductor = { + -- rules = rules, + state = mesecon.state.off, + onstate = "rmod:mesegrate_on" + }, + effector = { + action_on = function (pos, node) + minetest.swap_node(pos, {name = "rmod:mesegrate_on", param2 = node.param2}) + end, + } + } }) minetest.register_node("rmod:mesegrate_on", { @@ -19,10 +26,17 @@ minetest.register_node("rmod:mesegrate_on", { use_texture_alpha = true, drawtype = "glasslike", paramtype = "light", - mesecons = {effector = { - action_off = function (pos, node) - minetest.swap_node(pos, {name = "rmod:mesegrate_off", param2 = node.param2}) - end, - }}, + mesecons = { + conductor = { + -- rules = rules, + state = mesecon.state.on, + offstate = "rmod:mesegrate_off" + }, + effector = { + action_off = function (pos, node) + minetest.swap_node(pos, {name = "rmod:mesegrate_off", param2 = node.param2}) + end, + } + }, drop = "rmod:mesegrate_off" }) diff --git a/mod.conf b/mod.conf new file mode 100644 index 0000000..d81a826 --- /dev/null +++ b/mod.conf @@ -0,0 +1 @@ +name = rmod