From 3627b03b2ecb148140dc092e91d613c8dd05ef6d Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 10 Jan 2018 18:12:27 +0100 Subject: [PATCH] Set rules for observer --- mods/ITEMS/REDSTONE/mcl_observers/init.lua | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/mods/ITEMS/REDSTONE/mcl_observers/init.lua b/mods/ITEMS/REDSTONE/mcl_observers/init.lua index bd04aa3fb5..596792dda5 100644 --- a/mods/ITEMS/REDSTONE/mcl_observers/init.lua +++ b/mods/ITEMS/REDSTONE/mcl_observers/init.lua @@ -1,3 +1,14 @@ +local rules_flat = { + { x = 0, y = 0, z = -1 }, +} +local get_rules_flat = function(node) + local rules = rules_flat + for i=1, node.param2 do + rules = mesecon.rotate_rules_left(rules) + end + return rules +end + minetest.register_node("mcl_observers:observer", { description = "Observer", is_ground_content = false, @@ -28,7 +39,9 @@ minetest.register_node("mcl_observers:observer", { _mcl_hardness = 3.5, -- TODO: Mesecons handling mesecons = {effector = { - }} + rules = get_rules_flat, + }}, + on_rotate = false, }) minetest.register_craft({