From 8d144e47dba809db56d2b3adbf22d740ed7b8963 Mon Sep 17 00:00:00 2001 From: AntumDeluge Date: Tue, 6 Jun 2017 20:48:23 -0700 Subject: [PATCH] Replace deprecated methods: - 'setting_get' with 'settings:get' - 'setting_getbool' with 'settings:get_bool' --- functions.lua | 2 +- init.lua | 4 ++-- settings.lua | 2 +- spawn.lua | 8 ++++---- tnt_function.lua | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/functions.lua b/functions.lua index f9d55da..6044366 100644 --- a/functions.lua +++ b/functions.lua @@ -1,7 +1,7 @@ -- Functions for sneeker mod -local log_mods = minetest.setting_getbool('log_mods') +local log_mods = minetest.settings:get_bool('log_mods') -- Displays a message in log output diff --git a/init.lua b/init.lua index 2919aee..00b3877 100644 --- a/init.lua +++ b/init.lua @@ -5,7 +5,7 @@ sneeker = {} sneeker.modname = minetest.get_current_modname() sneeker.modpath = minetest.get_modpath(sneeker.modname) -if minetest.setting_getbool('log_mods') then +if minetest.settings:get_bool('log_mods') then minetest.log('action', 'Loading mod "' .. sneeker.modname .. '" ...') end @@ -353,7 +353,7 @@ if minetest.get_modpath('spawneggs') and minetest.get_modpath('tnt') then local pos = pointed_thing.above pos.y = pos.y+1 minetest.add_entity(pos, sneeker.mob_name) - if not minetest.setting_getbool('creative_mode') then + if not minetest.settings:get_bool('creative_mode') then itemstack:take_item() end return itemstack diff --git a/settings.lua b/settings.lua index ba2f711..e99c2ee 100644 --- a/settings.lua +++ b/settings.lua @@ -1,4 +1,4 @@ -- Settings for sneeker mod -sneeker.debug = minetest.setting_getbool('sneeker.debug') or false +sneeker.debug = minetest.settings:get_bool('sneeker.debug') or false diff --git a/spawn.lua b/spawn.lua index 45f0880..36a3fb5 100644 --- a/spawn.lua +++ b/spawn.lua @@ -5,10 +5,10 @@ local time_min = 60 local time_hr = time_min * 60 local time_day = time_hr * 24 -local spawn_cap = tonumber(minetest.setting_get('sneeker.spawn_cap')) or 10 -- Maximum number of spawns active at one time -local spawn_chance = tonumber(minetest.setting_get('sneeker.spawn_chance')) or 1000 -- 1/1000 chance of spawn -local spawn_interval = tonumber(minetest.setting_get('sneeker.spawn_interval')) or time_min * 4 -- Default interval is 4 minutes -local spawn_maxlight = tonumber(minetest.setting_get('sneeker.spawn_maxlight')) or 5 -- Maximum light of node for spawn +local spawn_cap = tonumber(minetest.settings:get('sneeker.spawn_cap')) or 10 -- Maximum number of spawns active at one time +local spawn_chance = tonumber(minetest.settings:get('sneeker.spawn_chance')) or 1000 -- 1/1000 chance of spawn +local spawn_interval = tonumber(minetest.settings:get('sneeker.spawn_interval')) or time_min * 4 -- Default interval is 4 minutes +local spawn_maxlight = tonumber(minetest.settings:get('sneeker.spawn_maxlight')) or 5 -- Maximum light of node for spawn local spawn_chance_percent = tostring(math.floor(1 / spawn_chance * 100)) .. '%' diff --git a/tnt_function.lua b/tnt_function.lua index 7a48215..1e3fd87 100644 --- a/tnt_function.lua +++ b/tnt_function.lua @@ -3,7 +3,7 @@ -- From TNT local cid_data = {} -local radius = tonumber(minetest.setting_get('tnt_radius') or 3) +local radius = tonumber(minetest.settings:get('tnt_radius') or 3) local large_radius = 5 local loss_prob = { ['default:cobble'] = 3,