Settings: Use new settings object
authorparamat <mat.gregory@virginmedia.com>
Mon, 22 May 2017 13:41:17 +0000 (14:41 +0100)
committerparamat <mat.gregory@virginmedia.com>
Wed, 24 May 2017 06:18:26 +0000 (07:18 +0100)
mods/beds/functions.lua
mods/bones/init.lua
mods/creative/init.lua
mods/default/functions.lua
mods/fire/init.lua
mods/give_initial_stuff/init.lua
mods/killme/init.lua
mods/stairs/init.lua
mods/tnt/init.lua

index 896844e5a480cda772a4188a994744b3e6a0c3a2..78df9a1816b925c1c406b4e71b34781ed3050862 100644 (file)
@@ -1,7 +1,7 @@
 local pi = math.pi
 local player_in_bed = 0
 local is_sp = minetest.is_singleplayer()
-local enable_respawn = minetest.setting_getbool("enable_bed_respawn")
+local enable_respawn = minetest.settings:get_bool("enable_bed_respawn")
 if enable_respawn == nil then
        enable_respawn = true
 end
@@ -22,7 +22,7 @@ local function get_look_yaw(pos)
 end
 
 local function is_night_skip_enabled()
-       local enable_night_skip = minetest.setting_getbool("enable_bed_night_skip")
+       local enable_night_skip = minetest.settings:get_bool("enable_bed_night_skip")
        if enable_night_skip == nil then
                enable_night_skip = true
        end
index 56f5fd04f5e2a1764bc7a727393d45f2af17a6f9..9583bc29b20e6add2839537de20297d8ef84bbd9 100644 (file)
@@ -21,8 +21,8 @@ local bones_formspec =
        "listring[current_player;main]" ..
        default.get_hotbar_bg(0,4.85)
 
-local share_bones_time = tonumber(minetest.setting_get("share_bones_time")) or 1200
-local share_bones_time_early = tonumber(minetest.setting_get("share_bones_time_early")) or share_bones_time / 4
+local share_bones_time = tonumber(minetest.settings:get("share_bones_time")) or 1200
+local share_bones_time_early = tonumber(minetest.settings:get("share_bones_time_early")) or share_bones_time / 4
 
 minetest.register_node("bones:bones", {
        description = "Bones",
@@ -161,7 +161,7 @@ end
 
 minetest.register_on_dieplayer(function(player)
 
-       local bones_mode = minetest.setting_get("bones_mode") or "bones"
+       local bones_mode = minetest.settings:get("bones_mode") or "bones"
        if bones_mode ~= "bones" and bones_mode ~= "drop" and bones_mode ~= "keep" then
                bones_mode = "bones"
        end
index bba9b34eea1aafeea6aa0dc8973f18b84ffe5ead..51d6f792e543bcc343248f521ac72b68a4714044 100644 (file)
@@ -1,6 +1,6 @@
 creative = {}
 
-local creative_mode_cache = minetest.setting_getbool("creative_mode")
+local creative_mode_cache = minetest.settings:get_bool("creative_mode")
 
 function creative.is_enabled_for(name)
        return creative_mode_cache
index 6d93f4281d93f797ac4fd1166c294437c1a66005..5dc22cab05d5c166da07bb758c8737788c1bdb69 100644 (file)
@@ -131,7 +131,7 @@ default.cool_lava = function(pos, node)
                {pos = pos, max_hear_distance = 16, gain = 0.25})
 end
 
-if minetest.setting_getbool("enable_lavacooling") ~= false then
+if minetest.settings:get_bool("enable_lavacooling") ~= false then
        minetest.register_abm({
                label = "Lava cooling",
                nodenames = {"default:lava_source", "default:lava_flowing"},
index 2dbf5dfd3febe7ce4804c15281644a431e84145a..f97636b5bd090d022909e5b5ff16f6d22fb1b65f 100644 (file)
@@ -148,7 +148,7 @@ minetest.override_item("default:coalblock", {
 -- Sound
 --
 
-local flame_sound = minetest.setting_getbool("flame_sound")
+local flame_sound = minetest.settings:get_bool("flame_sound")
 if flame_sound == nil then
        -- Enable if no setting present
        flame_sound = true
@@ -290,10 +290,10 @@ minetest.register_abm({
 
 -- Enable the following ABMs according to 'enable fire' setting
 
-local fire_enabled = minetest.setting_getbool("enable_fire")
+local fire_enabled = minetest.settings:get_bool("enable_fire")
 if fire_enabled == nil then
        -- enable_fire setting not specified, check for disable_fire
-       local fire_disabled = minetest.setting_getbool("disable_fire")
+       local fire_disabled = minetest.settings:get_bool("disable_fire")
        if fire_disabled == nil then
                -- Neither setting specified, check whether singleplayer
                fire_enabled = minetest.is_singleplayer()
index 022b74389b040d227266cd37f766a4e0a5bb891a..4815bd848120baaac26b42adc2e0e6820c695822 100644 (file)
@@ -1,4 +1,4 @@
-local stuff_string = minetest.setting_get("initial_stuff") or
+local stuff_string = minetest.settings:get("initial_stuff") or
                "default:pick_steel,default:axe_steel,default:shovel_steel," ..
                "default:torch 99,default:cobble 99"
 
@@ -39,6 +39,6 @@ function give_initial_stuff.get_list()
 end
 
 give_initial_stuff.add_from_csv(stuff_string)
-if minetest.setting_getbool("give_initial_stuff") then
+if minetest.settings:get_bool("give_initial_stuff") then
        minetest.register_on_newplayer(give_initial_stuff.give)
 end
index 06aa39def27daa955d14de848bf00f780f056384..9b674754a48b7cca180e73e60a648b91721de991 100644 (file)
@@ -3,7 +3,7 @@ minetest.register_chatcommand("killme", {
        func = function(name)
                local player = minetest.get_player_by_name(name)
                if player then
-                       if minetest.setting_getbool("enable_damage") then
+                       if minetest.settings:get_bool("enable_damage") then
                                player:set_hp(0)
                                return true
                        else
index 0ce3521803f8d6b1557efa81b07709af335eb5f9..90172ef041b654309a1f4e0dfc50608b9a9442b5 100644 (file)
@@ -15,7 +15,7 @@ minetest.register_alias("stairs:slab_pinewood", "stairs:slab_pine_wood")
 
 -- Get setting for replace ABM
 
-local replace = minetest.setting_getbool("enable_stairs_replace_abm")
+local replace = minetest.settings:get_bool("enable_stairs_replace_abm")
 
 local function rotate_and_place(itemstack, placer, pointed_thing)
        local p0 = pointed_thing.under
index e5ad5b166f8a8d2e624ba5d9a3d82640bf9389da..f54b2f1ad3b65b60c575f218c9a82b4c9cccabe2 100644 (file)
@@ -1,7 +1,7 @@
 tnt = {}
 
 -- Default to enabled when in singleplayer
-local enable_tnt = minetest.setting_getbool("enable_tnt")
+local enable_tnt = minetest.settings:get_bool("enable_tnt")
 if enable_tnt == nil then
        enable_tnt = minetest.is_singleplayer()
 end
@@ -12,7 +12,7 @@ local loss_prob = {}
 loss_prob["default:cobble"] = 3
 loss_prob["default:dirt"] = 4
 
-local tnt_radius = tonumber(minetest.setting_get("tnt_radius") or 3)
+local tnt_radius = tonumber(minetest.settings:get("tnt_radius") or 3)
 
 -- Fill a list with data for content IDs, after all nodes are registered
 local cid_data = {}