summaryrefslogtreecommitdiff
path: root/technic
diff options
context:
space:
mode:
Diffstat (limited to 'technic')
-rw-r--r--technic/config.lua3
-rw-r--r--technic/machines/HV/init.lua8
-rw-r--r--technic/machines/LV/init.lua12
-rw-r--r--technic/machines/MV/init.lua10
-rw-r--r--technic/machines/creative.lua25
-rw-r--r--technic/machines/init.lua2
-rw-r--r--technic/machines/power_monitor.lua2
-rw-r--r--technic/machines/switching_station.lua2
8 files changed, 36 insertions, 28 deletions
diff --git a/technic/config.lua b/technic/config.lua
index ab834f9..331e102 100644
--- a/technic/config.lua
+++ b/technic/config.lua
@@ -13,7 +13,8 @@ local defaults = {
enable_entity_radiation_damage = "true",
enable_longterm_radiation_damage = "true",
enable_nuclear_reactor_digiline_selfdestruct = "false",
- enable_creative_mode = "false",
+ creative_mode = "false",
+ enable_producers = "true",
}
for k, v in pairs(defaults) do
diff --git a/technic/machines/HV/init.lua b/technic/machines/HV/init.lua
index d7136b4..468932d 100644
--- a/technic/machines/HV/init.lua
+++ b/technic/machines/HV/init.lua
@@ -8,9 +8,11 @@ dofile(path.."/cables.lua")
dofile(path.."/battery_box.lua")
-- Generators
-dofile(path.."/solar_array.lua")
-dofile(path.."/nuclear_reactor.lua")
-dofile(path.."/generator.lua")
+if technic.config:get_bool("enable_producers") then
+ dofile(path.."/solar_array.lua")
+ dofile(path.."/nuclear_reactor.lua")
+ dofile(path.."/generator.lua")
+end
-- Machines
dofile(path.."/quarry.lua")
diff --git a/technic/machines/LV/init.lua b/technic/machines/LV/init.lua
index 30523c9..aeb6ce3 100644
--- a/technic/machines/LV/init.lua
+++ b/technic/machines/LV/init.lua
@@ -8,11 +8,13 @@ dofile(path.."/cables.lua")
dofile(path.."/battery_box.lua")
-- Generators
-dofile(path.."/solar_panel.lua")
-dofile(path.."/solar_array.lua")
-dofile(path.."/geothermal.lua")
-dofile(path.."/water_mill.lua")
-dofile(path.."/generator.lua")
+if technic.config:get_bool("enable_producers") then
+ dofile(path.."/solar_panel.lua")
+ dofile(path.."/solar_array.lua")
+ dofile(path.."/geothermal.lua")
+ dofile(path.."/water_mill.lua")
+ dofile(path.."/generator.lua")
+end
-- Machines
dofile(path.."/alloy_furnace.lua")
diff --git a/technic/machines/MV/init.lua b/technic/machines/MV/init.lua
index 72a98b6..bb9542d 100644
--- a/technic/machines/MV/init.lua
+++ b/technic/machines/MV/init.lua
@@ -8,11 +8,13 @@ dofile(path.."/cables.lua")
dofile(path.."/battery_box.lua")
-- Generators
-if technic.config:get_bool("enable_wind_mill") then
- dofile(path.."/wind_mill.lua")
+if technic.config:get_bool("enable_producers") then
+ if technic.config:get_bool("enable_wind_mill") then
+ dofile(path.."/wind_mill.lua")
+ end
+ dofile(path.."/generator.lua")
+ dofile(path.."/solar_array.lua")
end
-dofile(path.."/generator.lua")
-dofile(path.."/solar_array.lua")
-- Machines
dofile(path.."/alloy_furnace.lua")
diff --git a/technic/machines/creative.lua b/technic/machines/creative.lua
index 7c09a80..39abe74 100644
--- a/technic/machines/creative.lua
+++ b/technic/machines/creative.lua
@@ -1,40 +1,41 @@
local S = technic.getter
minetest.register_abm({
- nodenames = {"group:technic_lv","group:technic_mv","group:technic_hv"},
+ 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 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)
+ 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"))
+ 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)
+ nodedef.technic_run(pos, node)
end
end,
})
minetest.register_lbm({
- nodenames = {"technic:switching_station","technic:power_monitor"},
+ nodenames = {"technic:switching_station", "technic:power_monitor"},
name = "technic:update_infotext",
label = "Update switching station / power monitor infotext",
- action = function(pos,node)
+ run_at_every_load = true,
+ action = function(pos, node)
local meta = minetest.get_meta(pos)
if node.name == "technic:switching_station" then
- meta:set_string("infotext",S("Switching Station"))
+ meta:set_string("infotext", S("Switching Station"))
elseif node.name == "technic:power_monitor" then
- meta:set_string("infotext",S("Power Monitor"))
+ meta:set_string("infotext", S("Power Monitor"))
end
end,
})
diff --git a/technic/machines/init.lua b/technic/machines/init.lua
index b8d36c1..00ea158 100644
--- a/technic/machines/init.lua
+++ b/technic/machines/init.lua
@@ -13,7 +13,7 @@ dofile(path.."/supply_converter.lua")
dofile(path.."/other/init.lua")
-if technic.config:get_bool("enable_creative_mode") then
+if technic.config:get_bool("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")
diff --git a/technic/machines/power_monitor.lua b/technic/machines/power_monitor.lua
index 25836d6..0d709da 100644
--- a/technic/machines/power_monitor.lua
+++ b/technic/machines/power_monitor.lua
@@ -35,7 +35,7 @@ minetest.register_node("technic:power_monitor",{
end,
})
-if technic.config:get_bool("enable_creative_mode") then
+if technic.config:get_bool("creative_mode") then
--Power distribution is not used in this mode,
--so the power monitor is inert and never needs to run.
return
diff --git a/technic/machines/switching_station.lua b/technic/machines/switching_station.lua
index 2d96b9b..70765bf 100644
--- a/technic/machines/switching_station.lua
+++ b/technic/machines/switching_station.lua
@@ -88,7 +88,7 @@ minetest.register_node("technic:switching_station",{
},
})
-if technic.config:get_bool("enable_creative_mode") then
+if technic.config:get_bool("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.