diff --git a/mods/chatplus/api.lua b/mods/chatplus/api.lua index 1d963dd..5030985 100644 --- a/mods/chatplus/api.lua +++ b/mods/chatplus/api.lua @@ -30,7 +30,7 @@ function chatplus.init() end function chatplus.setting(name) - local get = minetest.setting_get("chatplus_" .. name) + local get = minetest.settings:get("chatplus_" .. name) if get then return get elseif chatplus._defsettings[name]~= nil then diff --git a/mods/ctf_pvp_engine b/mods/ctf_pvp_engine index 6f5bcd0..d341978 160000 --- a/mods/ctf_pvp_engine +++ b/mods/ctf_pvp_engine @@ -1 +1 @@ -Subproject commit 6f5bcd05d678811c86b6836786f97f3aafa67ffe +Subproject commit d341978b909b9fad5133c288e01930ffeaf9a9be diff --git a/mods/default/mapgen.lua b/mods/default/mapgen.lua index 7d9e102..9fb4038 100755 --- a/mods/default/mapgen.lua +++ b/mods/default/mapgen.lua @@ -310,7 +310,7 @@ function default.register_ores() }) end -local WATER_H = tonumber(minetest.setting_get("water_level")) +local WATER_H = tonumber(minetest.settings:get("water_level")) -- diff --git a/mods/dropondie/init.lua b/mods/dropondie/init.lua index 6abf131..1162bd9 100644 --- a/mods/dropondie/init.lua +++ b/mods/dropondie/init.lua @@ -20,7 +20,7 @@ local function drop(pos, itemstack) if obj then obj:setvelocity({x=math.random(-1,1), y=5, z=math.random(-1,1)}) - local remi = minetest.setting_get("remove_items") + local remi = minetest.settings:get("remove_items") if minetest.is_yes(remi) then obj:remove() end diff --git a/mods/gauges/init.lua b/mods/gauges/init.lua index f182bd6..00c5a09 100644 --- a/mods/gauges/init.lua +++ b/mods/gauges/init.lua @@ -58,8 +58,8 @@ function gauges.add_HP_gauge(name) end -- If health_bars not defined or set to true -if minetest.setting_getbool("health_bars") ~= false and - minetest.setting_getbool("enable_damage") then +if minetest.settings:get_bool("health_bars") ~= false and + minetest.settings:get_bool("enable_damage") then minetest.register_on_joinplayer(function(player) minetest.after(2, gauges.add_HP_gauge, player:get_player_name()) end) diff --git a/mods/hpregen/init.lua b/mods/hpregen/init.lua index 2b9c2b9..57bffa0 100644 --- a/mods/hpregen/init.lua +++ b/mods/hpregen/init.lua @@ -1,8 +1,8 @@ -local regen_interval = tonumber(minetest.setting_get("regen_interval")) +local regen_interval = tonumber(minetest.settings:get("regen_interval")) if regen_interval <= 0 then regen_interval = 6 end -local regen_amount = tonumber(minetest.setting_get("regen_amount")) +local regen_amount = tonumber(minetest.settings:get("regen_amount")) if regen_amount <= 0 then regen_amount = 1 end diff --git a/mods/random_messages/init.lua b/mods/random_messages/init.lua index 97bc9e2..62aafe2 100644 --- a/mods/random_messages/init.lua +++ b/mods/random_messages/init.lua @@ -27,13 +27,13 @@ function table.random( t ) -- luacheck: ignore end function random_messages.initialize() --Set the interval in minetest.conf. - minetest.setting_set("random_messages_interval",60) - minetest.setting_save(); + minetest.settings:set("random_messages_interval",60) + minetest.settings:write(); return 60 end function random_messages.set_interval() --Read the interval from minetest.conf and set it if it doesn't exist - MESSAGE_INTERVAL = tonumber(minetest.setting_get("random_messages_interval")) or random_messages.initialize() + MESSAGE_INTERVAL = tonumber(minetest.settings:get("random_messages_interval")) or random_messages.initialize() end function random_messages.check_params(name,func,params) diff --git a/mods/shooter/crossbow.lua b/mods/shooter/crossbow.lua index de7b949..354d8b5 100644 --- a/mods/shooter/crossbow.lua +++ b/mods/shooter/crossbow.lua @@ -179,7 +179,7 @@ for _, color in pairs(dye_basecolors) do groups = {not_in_creative_inventory=1}, on_use = function(itemstack, user, pointed_thing) minetest.sound_play("shooter_click", {object=user}) - if not minetest.setting_getbool("creative_mode") then + if not minetest.settings:get_bool("creative_mode") then itemstack:add_wear(65535/SHOOTER_CROSSBOW_USES) end itemstack = "shooter:crossbow 1 "..itemstack:get_wear() @@ -244,7 +244,7 @@ minetest.register_tool("shooter:crossbow", { local color = string.match(stack:get_name(), "shooter:arrow_(%a+)") if color then minetest.sound_play("shooter_reload", {object=user}) - if not minetest.setting_getbool("creative_mode") then + if not minetest.settings:get_bool("creative_mode") then inv:remove_item("main", "shooter:arrow_"..color.." 1") end return "shooter:crossbow_loaded_"..color.." 1 "..itemstack:get_wear() @@ -252,7 +252,7 @@ minetest.register_tool("shooter:crossbow", { for _, color in pairs(dye_basecolors) do if inv:contains_item("main", "shooter:arrow_"..color) then minetest.sound_play("shooter_reload", {object=user}) - if not minetest.setting_getbool("creative_mode") then + if not minetest.settings:get_bool("creative_mode") then inv:remove_item("main", "shooter:arrow_"..color.." 1") end return "shooter:crossbow_loaded_"..color.." 1 "..itemstack:get_wear() diff --git a/mods/shooter/flaregun.lua b/mods/shooter/flaregun.lua index 6904d3e..068c6eb 100644 --- a/mods/shooter/flaregun.lua +++ b/mods/shooter/flaregun.lua @@ -104,7 +104,7 @@ minetest.register_tool("shooter:flaregun", { minetest.sound_play("shooter_click", {object=user}) return itemstack end - if not minetest.setting_getbool("creative_mode") then + if not minetest.settings:get_bool("creative_mode") then inv:remove_item("main", "shooter:flare 1") itemstack:add_wear(65535/100) end @@ -144,4 +144,3 @@ if SHOOTER_ENABLE_CRAFTING == true then }, }) end - diff --git a/mods/shooter/grapple.lua b/mods/shooter/grapple.lua index 44a60b1..cca9206 100644 --- a/mods/shooter/grapple.lua +++ b/mods/shooter/grapple.lua @@ -4,7 +4,7 @@ local function throw_hook(itemstack, user, vel) local dir = user:get_look_dir() local yaw = user:get_look_yaw() if pos and dir and yaw then - if not minetest.setting_getbool("creative_mode") then + if not minetest.settings:get_bool("creative_mode") then itemstack:add_wear(65535/100) end pos.y = pos.y + 1.5 @@ -84,7 +84,7 @@ minetest.register_tool("shooter:grapple_gun", { inventory_image = "shooter_hook_gun.png", on_use = function(itemstack, user, pointed_thing) local inv = user:get_inventory() - if inv:contains_item("main", "shooter:grapple_hook") and + if inv:contains_item("main", "shooter:grapple_hook") and inv:contains_item("main", "tnt:gunpowder") then inv:remove_item("main", "tnt:gunpowder") minetest.sound_play("shooter_reload", {object=user}) @@ -129,4 +129,3 @@ if SHOOTER_ENABLE_CRAFTING == true then }, }) end - diff --git a/mods/shooter/grenade.lua b/mods/shooter/grenade.lua index 3445089..e926b4d 100644 --- a/mods/shooter/grenade.lua +++ b/mods/shooter/grenade.lua @@ -40,7 +40,7 @@ minetest.register_tool("shooter:grenade", { description = "Grenade", inventory_image = "shooter_hand_grenade.png", on_use = function(itemstack, user, pointed_thing) - if not minetest.setting_getbool("creative_mode") then + if not minetest.settings:get_bool("creative_mode") then itemstack = "" end -- clarification for future readers: grenade can be used only if player points at nothing (line 47) diff --git a/mods/shooter/rocket.lua b/mods/shooter/rocket.lua index ac9f6ed..f4d8f3f 100644 --- a/mods/shooter/rocket.lua +++ b/mods/shooter/rocket.lua @@ -46,7 +46,7 @@ minetest.register_tool("shooter:rocket_gun_loaded", { inventory_image = "shooter_rocket_gun_loaded.png", groups = {not_in_creative_inventory=1}, on_use = function(itemstack, user, pointed_thing) - if not minetest.setting_getbool("creative_mode") then + if not minetest.settings:get_bool("creative_mode") then itemstack:add_wear(65535/50) end itemstack = "shooter:rocket_gun 1 "..itemstack:get_wear() @@ -85,7 +85,7 @@ minetest.register_tool("shooter:rocket_gun", { local inv = user:get_inventory() if inv:contains_item("main", "shooter:rocket") then minetest.sound_play("shooter_reload", {object=user}) - if not minetest.setting_getbool("creative_mode") then + if not minetest.settings:get_bool("creative_mode") then inv:remove_item("main", "shooter:rocket 1") end itemstack = "shooter:rocket_gun_loaded 1 "..itemstack:get_wear() @@ -111,4 +111,3 @@ if SHOOTER_ENABLE_CRAFTING == true then }, }) end - diff --git a/mods/shooter/turret.lua b/mods/shooter/turret.lua index 67472d9..002f782 100644 --- a/mods/shooter/turret.lua +++ b/mods/shooter/turret.lua @@ -50,7 +50,7 @@ minetest.register_entity("shooter:tnt_entity", { end, get_staticdata = function(self) return "expired" - end, + end, }) minetest.register_entity("shooter:turret_entity", { @@ -92,7 +92,7 @@ minetest.register_entity("shooter:turret_entity", { self.timer = self.timer + dtime if self.timer < 0.1 then return - end + end if self.player then local pitch = self.pitch local yaw = self.object:getyaw() @@ -122,7 +122,7 @@ minetest.register_entity("shooter:turret_entity", { end if pitch < 0 then pitch = 0 - elseif pitch > 90 then + elseif pitch > 90 then pitch = 90 end if self.pitch ~= pitch then @@ -148,7 +148,7 @@ minetest.register_entity("shooter:turret_entity", { return end minetest.sound_play("shooter_shotgun", {object=self.object}) - if not minetest.setting_getbool("creative_mode") then + if not minetest.settings:get_bool("creative_mode") then inv:remove_item("main", "tnt:tnt") end local pitch = math.rad(self.pitch - 40) @@ -263,4 +263,3 @@ if SHOOTER_ENABLE_CRAFTING == true then }, }) end - diff --git a/mods/tsm_chests/init.lua b/mods/tsm_chests/init.lua index 87b6a81..fdf3c22 100755 --- a/mods/tsm_chests/init.lua +++ b/mods/tsm_chests/init.lua @@ -83,7 +83,7 @@ local h_max = 40 -- maximum chest spawning height, relative to water_level local t_min = 4 -- minimum amount of treasures found in a chest local t_max = 7 -- maximum amount of treasures found in a chest -local water_level = tonumber(minetest.setting_get("water_level")) +local water_level = tonumber(minetest.settings:get("water_level")) local get_node = minetest.get_node local function findGroundLevel(pos, y_min, y_max) diff --git a/mods/vote/init.lua b/mods/vote/init.lua index 2106b4e..c8edab0 100644 --- a/mods/vote/init.lua +++ b/mods/vote/init.lua @@ -4,8 +4,8 @@ vote = { } function vote.new_vote(creator, voteset) - local max_votes = tonumber(minetest.setting_get("vote.maximum_active")) or 1 - local max_queue = tonumber(minetest.setting_get("vote.maximum_active")) or 0 + local max_votes = tonumber(minetest.settings:get("vote.maximum_active")) or 1 + local max_queue = tonumber(minetest.settings:get("vote.maximum_active")) or 0 if #vote.active < max_votes then vote.start_vote(voteset) @@ -90,7 +90,7 @@ function vote.end_vote(voteset) voteset:on_result(result, voteset.results) end - local max_votes = tonumber(minetest.setting_get("vote.maximum_active")) or 1 + local max_votes = tonumber(minetest.settings:get("vote.maximum_active")) or 1 if #vote.active < max_votes and #vote.queue > 0 then local nextvote = table.remove(vote.queue, 1) vote.start_vote(nextvote) @@ -308,7 +308,7 @@ minetest.register_chatcommand("abstain", { end }) -local set = minetest.setting_get("vote.kick_vote") +local set = minetest.settings:get("vote.kick_vote") if set == nil or minetest.is_yes(set) then dofile(minetest.get_modpath("vote") .. "/vote_kick.lua") end