From b11cd8afbf31b73149e6fbd6876e38a158c220cc Mon Sep 17 00:00:00 2001 From: DustyBagel Date: Mon, 25 Aug 2025 13:19:41 -0500 Subject: [PATCH 1/2] Start using settingtypes.txt --- settingtypes.txt | 27 +++++++++++++++++++++++++++ technic/config.lua | 8 ++++++++ 2 files changed, 35 insertions(+) diff --git a/settingtypes.txt b/settingtypes.txt index 4764c8844..35197673a 100644 --- a/settingtypes.txt +++ b/settingtypes.txt @@ -7,3 +7,30 @@ # # Disabling this feature will sacrifice safety for convenience. technic_safe_chainsaw (Chainsaw safety feature) bool true + +# Enables the mining drills. +enable_mining_drill (Enable Mining Drill) bool true + +# Enables Wind Mills. +enable_wind_mill (Enable Wind Mill) bool false + +# Enables the Flashlight. +enable_ (Enable Flashlight) bool false + +# Enables Frames. +enable_frames (Enable Frames) bool false + +# Enables Corium Griefing. +enable_corium_griefing (Enable corium_griefing) bool true + +# Enables Radiation Protection. +enable_radiation_protection (Enable Radiation Protection) bool true + +# Enables Entity Radiation Damage. +enable_entity_radiation_damage (Enable Entity Radiation Damage) bool true + +# Enables Long Term Radiation Damage. +enable_longterm_radiation_damage (Enable Long Term Radiation Damage) bool true + +# Enables Nuclear Reactor Digiline Selfdestruct. +enable_nuclear_reactor_digiline_selfdestruct (Enable Nuclear Reactor Digiline Selfdestruct) bool false \ No newline at end of file diff --git a/technic/config.lua b/technic/config.lua index bb748ec43..d4a9b7ef7 100644 --- a/technic/config.lua +++ b/technic/config.lua @@ -2,6 +2,13 @@ technic.config = technic.config or Settings(minetest.get_worldpath().."/technic. local conf_table = technic.config:to_table() +local function bool_to_string(bool) + if bool then + return "true" + end + return "false" +end + local defaults = { enable_mining_drill = "true", enable_mining_laser = "true", @@ -13,6 +20,7 @@ local defaults = { enable_entity_radiation_damage = "true", enable_longterm_radiation_damage = "true", enable_nuclear_reactor_digiline_selfdestruct = "false", + technic_safe_chainsaw = "true", } for k, v in pairs(defaults) do From 2027918999227a5f56e872726b6ed5988720a7a3 Mon Sep 17 00:00:00 2001 From: DustyBagel Date: Mon, 25 Aug 2025 13:44:48 -0500 Subject: [PATCH 2/2] Fix Setting Loading --- settingtypes.txt | 2 +- technic/config.lua | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/settingtypes.txt b/settingtypes.txt index 35197673a..a09555b6a 100644 --- a/settingtypes.txt +++ b/settingtypes.txt @@ -15,7 +15,7 @@ enable_mining_drill (Enable Mining Drill) bool true enable_wind_mill (Enable Wind Mill) bool false # Enables the Flashlight. -enable_ (Enable Flashlight) bool false +enable_flashlight (Enable Flashlight) bool false # Enables Frames. enable_frames (Enable Frames) bool false diff --git a/technic/config.lua b/technic/config.lua index d4a9b7ef7..db0ec143b 100644 --- a/technic/config.lua +++ b/technic/config.lua @@ -25,6 +25,11 @@ local defaults = { for k, v in pairs(defaults) do if conf_table[k] == nil then - technic.config:set(k, v) + local minetest_val = minetest.settings:get(k) + if minetest_val == nil then + technic.config:set(k, v) + else + technic.config:set(k, bool_to_string(minetest_val)) + end end end