replace deprecated setting methods

This commit is contained in:
DS-Minetest 2017-07-05 18:52:46 +02:00
parent a7da195aa1
commit e8a666f34e
5 changed files with 13 additions and 13 deletions

View File

@ -1,5 +1,5 @@
-- minetest time speed
local time_speed = tonumber(minetest.setting_get("time_speed"))
local time_speed = tonumber(minetest.settings:get("time_speed"))
if not time_speed then
time_speed = 1
else
@ -250,7 +250,7 @@ minetest.register_abm({
if last_time == current_time then
return
end
local timediff = get_timediff(last_time, current_time)+meta:get_string("timedif")
local times = math.floor(timediff)
meta:set_string("last_active", current_time)
@ -272,13 +272,13 @@ minetest.register_abm({
local srclist = inv:get_list("src")
local cooked = nil
local aftercooked
if srclist then
cooked, aftercooked = minetest.get_craft_result({method = "cooking", width = 1, items = srclist})
end
local was_active = false
if meta:get_float("fuel_time") < meta:get_float("fuel_totaltime") then
was_active = true
meta:set_float("fuel_time", meta:get_float("fuel_time") + 1)
@ -298,7 +298,7 @@ minetest.register_abm({
meta:set_string("src_time", 0)
end
end
if meta:get_float("fuel_time") < meta:get_float("fuel_totaltime") then
local percent = math.floor(meta:get_float("fuel_time") /
meta:get_float("fuel_totaltime") * 100)
@ -313,7 +313,7 @@ minetest.register_abm({
local cooked = nil
local fuellist = inv:get_list("fuel")
local srclist = inv:get_list("src")
if srclist then
cooked = minetest.get_craft_result({method = "cooking", width = 1, items = srclist})
end
@ -339,7 +339,7 @@ minetest.register_abm({
meta:set_string("fuel_totaltime", fuel.time)
meta:set_string("fuel_time", 0)
inv:set_stack("fuel", 1, afterfuel.items[1])
end
end,

View File

@ -291,7 +291,7 @@ local guide_size = {x=40, y=10, cx=0.2, cy=0.2}
local formspec_offset = {x=0.25, y=0.50}
local font_size
if minetest.is_singleplayer() then
font_size = tonumber(minetest.setting_get("font_size")) or 13
font_size = tonumber(minetest.settings:get("font_size")) or 13
else
font_size = 13
end

View File

@ -142,7 +142,7 @@ local function do_ws_func(depth, a, x)
return SIZE * y / math.pi
end
local chunksize = minetest.setting_get("chunksize") or 5
local chunksize = minetest.settings:get("chunksize") or 5
local ws_lists = {}
local function get_ws_list(a,x)
ws_lists[a] = ws_lists[a] or {}

View File

@ -7,7 +7,7 @@ local function table_contains(t, v)
return false
end
local creative = minetest.setting_getbool("creative_mode")
local creative = minetest.settings:get_bool("creative_mode")
local function throw_pearl(item, player)
local playerpos = player:getpos()
playerpos.y = playerpos.y+1.625

View File

@ -2,7 +2,7 @@
-- kills the player if he uses PilzAdam portal
local portal_target = nether.buildings+1
local nether_prisons = minetest.setting_getbool("enable_damage")
local nether_prisons = minetest.settings:get_bool("enable_damage")
local obsidian_portal_kills = nether_prisons and true
local mclike_portal = false
@ -549,7 +549,7 @@ minetest.after(0.1, function()
player:get_player_name(),
"Warning: If you are in the nether you may not be able to find the way out!"
)
if not minetest.setting_getbool("creative_mode") then
if not minetest.settings:get_bool("creative_mode") then
stack:take_item()
end
end