diff options
Diffstat (limited to 'technic/machines')
-rw-r--r-- | technic/machines/creative.lua | 40 | ||||
-rw-r--r-- | technic/machines/init.lua | 5 | ||||
-rw-r--r-- | technic/machines/power_monitor.lua | 6 | ||||
-rw-r--r-- | technic/machines/register/alloy_recipes.lua | 2 | ||||
-rw-r--r-- | technic/machines/register/battery_box.lua | 2 | ||||
-rw-r--r-- | technic/machines/register/grinder_recipes.lua | 6 | ||||
-rw-r--r-- | technic/machines/switching_station.lua | 7 |
7 files changed, 63 insertions, 5 deletions
diff --git a/technic/machines/creative.lua b/technic/machines/creative.lua new file mode 100644 index 0000000..7c09a80 --- /dev/null +++ b/technic/machines/creative.lua @@ -0,0 +1,40 @@ +local S = technic.getter + +minetest.register_abm({ + nodenames = {"group:technic_lv","group:technic_mv","group:technic_hv"}, + label = "Run Machines", + interval = 1, + chance = 1, + action = function(pos,node) + local meta = minetest.get_meta(pos) + local pos1 = {x=pos.x,y=pos.y-1,z=pos.z} + local tier = technic.get_cable_tier(minetest.get_node(pos1).name) + local meta = minetest.get_meta(pos) + if not tier then + meta:set_int("active",0) + return + end + meta:set_int("active",1) + meta:set_int("LV_EU_input",meta:get_int("LV_EU_demand")) + meta:set_int("MV_EU_input",meta:get_int("MV_EU_demand")) + meta:set_int("HV_EU_input",meta:get_int("HV_EU_demand")) + local nodedef = minetest.registered_nodes[node.name] + if nodedef and nodedef.technic_run then + nodedef.technic_run(pos,node) + end + end, +}) + +minetest.register_lbm({ + nodenames = {"technic:switching_station","technic:power_monitor"}, + name = "technic:update_infotext", + label = "Update switching station / power monitor infotext", + action = function(pos,node) + local meta = minetest.get_meta(pos) + if node.name == "technic:switching_station" then + meta:set_string("infotext",S("Switching Station")) + elseif node.name == "technic:power_monitor" then + meta:set_string("infotext",S("Power Monitor")) + end + end, +}) diff --git a/technic/machines/init.lua b/technic/machines/init.lua index f2e31c9..b8d36c1 100644 --- a/technic/machines/init.lua +++ b/technic/machines/init.lua @@ -13,3 +13,8 @@ dofile(path.."/supply_converter.lua") dofile(path.."/other/init.lua") +if technic.config:get_bool("enable_creative_mode") then + --The switching station does not handle running machines + --in this mode, so alternative means are used to do so. + dofile(path.."/creative.lua") +end diff --git a/technic/machines/power_monitor.lua b/technic/machines/power_monitor.lua index 7e8b850..25836d6 100644 --- a/technic/machines/power_monitor.lua +++ b/technic/machines/power_monitor.lua @@ -35,6 +35,12 @@ minetest.register_node("technic:power_monitor",{ end, }) +if technic.config:get_bool("enable_creative_mode") then + --Power distribution is not used in this mode, + --so the power monitor is inert and never needs to run. + return +end + minetest.register_abm({ nodenames = {"technic:power_monitor"}, label = "Machines: run power monitor", diff --git a/technic/machines/register/alloy_recipes.lua b/technic/machines/register/alloy_recipes.lua index bd09bd6..3aeacd5 100644 --- a/technic/machines/register/alloy_recipes.lua +++ b/technic/machines/register/alloy_recipes.lua @@ -13,7 +13,7 @@ end local recipes = { {"technic:copper_dust 3", "technic:tin_dust", "technic:bronze_dust 4"}, - {"default:copper_ingot 3", "moreores:tin_ingot", "default:bronze_ingot 4"}, + {"default:copper_ingot 3", "default:tin_ingot", "default:bronze_ingot 4"}, {"technic:wrought_iron_dust", "technic:coal_dust", "technic:carbon_steel_dust", 3}, {"technic:wrought_iron_ingot", "technic:coal_dust", "technic:carbon_steel_ingot", 3}, {"technic:carbon_steel_dust", "technic:coal_dust", "technic:cast_iron_dust", 3}, diff --git a/technic/machines/register/battery_box.lua b/technic/machines/register/battery_box.lua index 7f25dfd..d10b705 100644 --- a/technic/machines/register/battery_box.lua +++ b/technic/machines/register/battery_box.lua @@ -18,7 +18,7 @@ minetest.register_craft({ output = "technic:battery", recipe = { {"group:wood", "default:copper_ingot", "group:wood"}, - {"group:wood", "moreores:tin_ingot", "group:wood"}, + {"group:wood", "default:tin_ingot", "group:wood"}, {"group:wood", "default:copper_ingot", "group:wood"}, } }) diff --git a/technic/machines/register/grinder_recipes.lua b/technic/machines/register/grinder_recipes.lua index fa55e7a..1f4047c 100644 --- a/technic/machines/register/grinder_recipes.lua +++ b/technic/machines/register/grinder_recipes.lua @@ -15,6 +15,7 @@ local recipes = { {"default:desert_stone", "default:desert_sand"}, {"default:gold_lump", "technic:gold_dust 2"}, {"default:iron_lump", "technic:wrought_iron_dust 2"}, + {"default:tin_lump", "technic:tin_dust 2"}, {"technic:chromium_lump", "technic:chromium_dust 2"}, {"technic:uranium_lump", "technic:uranium_dust 2"}, {"technic:zinc_lump", "technic:zinc_dust 2"}, @@ -43,7 +44,6 @@ end if minetest.get_modpath("moreores") then table.insert(recipes, {"moreores:mithril_lump", "technic:mithril_dust 2"}) table.insert(recipes, {"moreores:silver_lump", "technic:silver_dust 2"}) - table.insert(recipes, {"moreores:tin_lump", "technic:tin_dust 2"}) end if minetest.get_modpath("gloopores") or minetest.get_modpath("glooptest") then @@ -94,9 +94,9 @@ register_dust("Gold", "default:gold_ingot") register_dust("Mithril", "moreores:mithril_ingot") register_dust("Silver", "moreores:silver_ingot") register_dust("Stainless Steel", "technic:stainless_steel_ingot") -register_dust("Stone", "default:stone") +register_dust("Stone", "default:stone") register_dust("Sulfur", nil) -register_dust("Tin", "moreores:tin_ingot") +register_dust("Tin", "default:tin_ingot") register_dust("Wrought Iron", "technic:wrought_iron_ingot") register_dust("Zinc", "technic:zinc_ingot") if minetest.get_modpath("gloopores") or minetest.get_modpath("glooptest") then diff --git a/technic/machines/switching_station.lua b/technic/machines/switching_station.lua index d645847..2d96b9b 100644 --- a/technic/machines/switching_station.lua +++ b/technic/machines/switching_station.lua @@ -88,6 +88,13 @@ minetest.register_node("technic:switching_station",{ }, }) +if technic.config:get_bool("enable_creative_mode") then + --Power distribution is not used in this mode, + --so the switching station is inert and none of the + --network processing is needed. + return +end + -------------------------------------------------- -- Functions to traverse the electrical network -------------------------------------------------- |