From 812b0f977e9a470c61936dc5478f859ebb786b33 Mon Sep 17 00:00:00 2001 From: Hybrid Dog Date: Sun, 18 Jun 2017 12:09:12 +0200 Subject: [PATCH] Use new setting functions --- src/snowball.lua | 6 +++--- src/stairsplus.lua | 2 +- src/util.lua | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/snowball.lua b/src/snowball.lua index 2d26dd7..b373d2f 100644 --- a/src/snowball.lua +++ b/src/snowball.lua @@ -6,13 +6,13 @@ -- Quite a bit of trial-and-error learning here and it boiled down to a -- small handful of code lines making the difference. ~ LazyJ -local creative_mode = minetest.setting_getbool("creative_mode") +local creative_mode = minetest.settings:get_bool"creative_mode" local snowball_velocity, entity_attack_delay local function update_snowball_vel(v) snowball_velocity = v - local walkspeed = tonumber(minetest.setting_get("movement_speed_walk")) or 4 + local walkspeed = tonumber(minetest.settings:get"movement_speed_walk") or 4 entity_attack_delay = (walkspeed+1)/v end update_snowball_vel(snow.snowball_velocity) @@ -27,7 +27,7 @@ snow.register_on_configuring(function(name, v) end) local function get_gravity() - local grav = tonumber(minetest.setting_get("movement_gravity")) or 9.81 + local grav = tonumber(minetest.settings:get"movement_gravity") or 9.81 return grav*snowball_gravity end diff --git a/src/stairsplus.lua b/src/stairsplus.lua index 6fb965d..550086d 100644 --- a/src/stairsplus.lua +++ b/src/stairsplus.lua @@ -36,7 +36,7 @@ There is one in each of the "stairsplus.register_all" sections. -- Check for infinite stacks ---if minetest.get_modpath("unified_inventory") or not minetest.setting_getbool("creative_mode") then +--if minetest.get_modpath("unified_inventory") or not minetest.settigetbool("creative_mode") then -- snow_stairsplus.expect_infinite_stacks = false --else -- snow_stairsplus.expect_infinite_stacks = true diff --git a/src/util.lua b/src/util.lua index bb26a22..d1e1b55 100644 --- a/src/util.lua +++ b/src/util.lua @@ -132,7 +132,7 @@ end for i,v in pairs(snow) do if allowed_types[type(v)] then - local v = minetest.setting_get("snow_"..i) + local v = minetest.settings:get("snow_"..i) if v ~= nil then snow[i] = value_from_string(v) end