From a9152327a20268a16b210e52a25a46010eb4eba9 Mon Sep 17 00:00:00 2001 From: Anthony Zhang Date: Fri, 17 Feb 2012 18:18:27 -0500 Subject: Fix inverter states. --- jeija/temperest.lua | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/jeija/temperest.lua b/jeija/temperest.lua index 6a3214f..134c7b8 100644 --- a/jeija/temperest.lua +++ b/jeija/temperest.lua @@ -76,6 +76,7 @@ end mesecon:register_on_signal_on(plug_on) mesecon:register_on_signal_off(plug_off) +minetest.register_on_placenode(plug_off) minetest.register_on_dignode(plug_off) minetest.register_craft({ @@ -114,7 +115,7 @@ minetest.register_node("jeija:mesecon_socket_on", { selection_box = { type = "fixed", }, - drop='node "jeija:mesecon_socket_off" 1', + drop='"jeija:mesecon_socket_off" 1', }) minetest.register_on_dignode( @@ -140,33 +141,38 @@ minetest.register_craft({ --TEMPEREST-INVERTER minetest.register_node("jeija:mesecon_inverter_off", { - description = "Inverter", drawtype = "raillike", paramtype = "light", is_ground_content = true, tile_images = {"jeija_mesecon_inverter_off.png"}, - inventory_image = "jeija_mesecon_inverter_off.png", - wield_image = "jeija_mesecon_inverter_off.png", material = minetest.digprop_constanttime(0.1), walkable = false, selection_box = { type = "fixed", }, + drop='"jeija:mesecon_inverter_on" 1', }) minetest.register_node("jeija:mesecon_inverter_on", { + description = "Inverter", drawtype = "raillike", paramtype = "light", is_ground_content = true, tile_images = {"jeija_mesecon_inverter_on.png"}, + inventory_image = "jeija_mesecon_inverter_on.png", + wield_image = "jeija_mesecon_inverter_on.png", material = minetest.digprop_constanttime(0.1), walkable = false, selection_box = { type = "fixed", }, - drop='node "jeija:mesecon_inverter_off" 1', }) +minetest.register_on_placenode(function(pos, node) + mesecon:receptor_on(pos) +end +) + minetest.register_on_dignode( function(pos, oldnode, digger) if oldnode.name == "jeija:mesecon_inverter_on" then @@ -179,7 +185,7 @@ mesecon:add_receptor_node("jeija:mesecon_inverter_on") mesecon:add_receptor_node_off("jeija:mesecon_inverter_off") minetest.register_craft({ - output = 'node "jeija:mesecon_inverter_off" 2', + output = 'node "jeija:mesecon_inverter_on" 2', recipe = { {'node "jeija:mesecon_off"', 'craft "default:steel_ingot"', 'node "jeija:mesecon_off"'}, {'craft "default:steel_ingot"', '', 'craft "default:steel_ingot"'}, -- cgit v1.2.3