Replace deprecated methods:

- 'setting_get' with 'settings:get'
- 'setting_getbool' with 'settings:get_bool'
This commit is contained in:
AntumDeluge 2017-05-13 01:47:23 -07:00
parent fc01ffb165
commit 66b62f2435

@ -9,11 +9,11 @@ local config = {}
local function setting(stype, name, default, description) local function setting(stype, name, default, description)
local value local value
if stype == "bool" then if stype == "bool" then
value = minetest.setting_getbool(CONFIG_FILE_PREFIX..name) value = minetest.settings:get_bool(CONFIG_FILE_PREFIX..name)
elseif stype == "string" then elseif stype == "string" then
value = minetest.setting_get(CONFIG_FILE_PREFIX..name) value = minetest.settings:get(CONFIG_FILE_PREFIX..name)
elseif stype == "int" or stype == "float" then elseif stype == "int" or stype == "float" then
value = tonumber(minetest.setting_get(CONFIG_FILE_PREFIX..name)) value = tonumber(minetest.settings:get(CONFIG_FILE_PREFIX..name))
end end
if value == nil then if value == nil then
value = default value = default
@ -86,7 +86,7 @@ local function use_airtank(itemstack, user, pointed_thing, full_item)
user:set_breath(breath) user:set_breath(breath)
minetest.sound_play("airtanks_hiss", {pos = user:getpos(), gain = 0.5}) minetest.sound_play("airtanks_hiss", {pos = user:getpos(), gain = 0.5})
if (not minetest.setting_getbool("creative_mode")) or config.wear_in_creative then if (not minetest.settings:get_bool("creative_mode")) or config.wear_in_creative then
local wdef = itemstack:get_definition() local wdef = itemstack:get_definition()
itemstack:add_wear(65535/(wdef._airtank_uses-1)) itemstack:add_wear(65535/(wdef._airtank_uses-1))
if itemstack:get_count() == 0 then if itemstack:get_count() == 0 then