diff --git a/README.md b/README.md index 5cb79bd..05d3075 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Textures: CC BY-SA 3.0 ### Dependencies Required: default, tubelib2, basic_materials, bucket, stairs -Optional: unified_inventory, wielded_light +Optional: unified_inventory, wielded_light, minecart Highly recommended: signs_bot, minecart ### History diff --git a/coal_power_station/boiler_top.lua b/coal_power_station/boiler_top.lua index 267df7a..54b6a53 100644 --- a/coal_power_station/boiler_top.lua +++ b/coal_power_station/boiler_top.lua @@ -233,6 +233,7 @@ minetest.register_node("techage:coalboiler_top", { on_timer = node_timer, allow_metadata_inventory_put = allow_metadata_inventory_put, allow_metadata_inventory_take = allow_metadata_inventory_take, + allow_metadata_inventory_move = function(pos) return 0 end, on_receive_fields = on_receive_fields, on_rightclick = on_rightclick, diff --git a/mod.conf b/mod.conf index 05d54f8..53ee3a8 100644 --- a/mod.conf +++ b/mod.conf @@ -1,4 +1,4 @@ name = techage depends = default,tubelib2,basic_materials,bucket,stairs -optional_depends = unified_inventory,wielded_light +optional_depends = unified_inventory,wielded_light,minecart description = Techage, go through 4 tech ages in search of wealth and power! \ No newline at end of file diff --git a/power/power.lua b/power/power.lua index 1aa8bc4..9f7f812 100644 --- a/power/power.lua +++ b/power/power.lua @@ -315,13 +315,17 @@ end function techage.power.provide_power(pos, provide) local mem = tubelib2.get_mem(pos) if mem.is_master then - accounting(mem) - trigger_lamps(pos, mem) + --nothing todo elseif mem.master_pos then mem = tubelib2.get_mem(mem.master_pos) else return 0 end + if (mem.next_cycle or 0) < minetest.get_us_time() then + accounting(mem) + trigger_lamps(pos, mem) + mem.next_cycle = minetest.get_us_time() + 2000000 -- 2s + end -- for next cycle mem.available1 = (mem.available1 or 0) + provide -- current cycle diff --git a/power/power_line.lua b/power/power_line.lua index 840afab..221fc00 100644 --- a/power/power_line.lua +++ b/power/power_line.lua @@ -209,8 +209,17 @@ minetest.register_craft({ minetest.register_craft({ output = "techage:power_pole", recipe = { - {"default:stick", "techage:power_line", "default:stick"}, - {"techage:power_line", "default:copper_ingot", "techage:power_line"}, - {"default:stick", "techage:power_line", "default:stick"}, + {"default:stick", "techage:power_lineS", "default:stick"}, + {"techage:power_lineS", "default:copper_ingot", "techage:power_lineS"}, + {"default:stick", "techage:power_lineS", "default:stick"}, }, }) + +if minetest.global_exists("minecart") and minecart.register_protected_node then + minecart.register_protected_node("techage:power_line") + minecart.register_protected_node("techage:power_lineS") + minecart.register_protected_node("techage:power_lineA") + minecart.register_protected_node("techage:power_pole") + minecart.register_protected_node("default:fence_wood") + +end \ No newline at end of file diff --git a/steam_engine/boiler.lua b/steam_engine/boiler.lua index 55038b1..170aeb6 100644 --- a/steam_engine/boiler.lua +++ b/steam_engine/boiler.lua @@ -241,6 +241,7 @@ minetest.register_node("techage:boiler2", { on_timer = node_timer, allow_metadata_inventory_put = allow_metadata_inventory_put, allow_metadata_inventory_take = allow_metadata_inventory_take, + allow_metadata_inventory_move = function(pos) return 0 end, on_receive_fields = on_receive_fields, on_rightclick = on_rightclick,