forked from minetest/minetest_game
Settings: Use new settings object
This commit is contained in:
parent
e523c3a296
commit
eec1c5a03b
@ -1,7 +1,7 @@
|
|||||||
local pi = math.pi
|
local pi = math.pi
|
||||||
local player_in_bed = 0
|
local player_in_bed = 0
|
||||||
local is_sp = minetest.is_singleplayer()
|
local is_sp = minetest.is_singleplayer()
|
||||||
local enable_respawn = minetest.setting_getbool("enable_bed_respawn")
|
local enable_respawn = minetest.settings:get_bool("enable_bed_respawn")
|
||||||
if enable_respawn == nil then
|
if enable_respawn == nil then
|
||||||
enable_respawn = true
|
enable_respawn = true
|
||||||
end
|
end
|
||||||
@ -22,7 +22,7 @@ local function get_look_yaw(pos)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function is_night_skip_enabled()
|
local function is_night_skip_enabled()
|
||||||
local enable_night_skip = minetest.setting_getbool("enable_bed_night_skip")
|
local enable_night_skip = minetest.settings:get_bool("enable_bed_night_skip")
|
||||||
if enable_night_skip == nil then
|
if enable_night_skip == nil then
|
||||||
enable_night_skip = true
|
enable_night_skip = true
|
||||||
end
|
end
|
||||||
|
@ -21,8 +21,8 @@ local bones_formspec =
|
|||||||
"listring[current_player;main]" ..
|
"listring[current_player;main]" ..
|
||||||
default.get_hotbar_bg(0,4.85)
|
default.get_hotbar_bg(0,4.85)
|
||||||
|
|
||||||
local share_bones_time = tonumber(minetest.setting_get("share_bones_time")) or 1200
|
local share_bones_time = tonumber(minetest.settings:get("share_bones_time")) or 1200
|
||||||
local share_bones_time_early = tonumber(minetest.setting_get("share_bones_time_early")) or share_bones_time / 4
|
local share_bones_time_early = tonumber(minetest.settings:get("share_bones_time_early")) or share_bones_time / 4
|
||||||
|
|
||||||
minetest.register_node("bones:bones", {
|
minetest.register_node("bones:bones", {
|
||||||
description = "Bones",
|
description = "Bones",
|
||||||
@ -161,7 +161,7 @@ end
|
|||||||
|
|
||||||
minetest.register_on_dieplayer(function(player)
|
minetest.register_on_dieplayer(function(player)
|
||||||
|
|
||||||
local bones_mode = minetest.setting_get("bones_mode") or "bones"
|
local bones_mode = minetest.settings:get("bones_mode") or "bones"
|
||||||
if bones_mode ~= "bones" and bones_mode ~= "drop" and bones_mode ~= "keep" then
|
if bones_mode ~= "bones" and bones_mode ~= "drop" and bones_mode ~= "keep" then
|
||||||
bones_mode = "bones"
|
bones_mode = "bones"
|
||||||
end
|
end
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
creative = {}
|
creative = {}
|
||||||
|
|
||||||
local creative_mode_cache = minetest.setting_getbool("creative_mode")
|
local creative_mode_cache = minetest.settings:get_bool("creative_mode")
|
||||||
|
|
||||||
function creative.is_enabled_for(name)
|
function creative.is_enabled_for(name)
|
||||||
return creative_mode_cache
|
return creative_mode_cache
|
||||||
|
@ -131,7 +131,7 @@ default.cool_lava = function(pos, node)
|
|||||||
{pos = pos, max_hear_distance = 16, gain = 0.25})
|
{pos = pos, max_hear_distance = 16, gain = 0.25})
|
||||||
end
|
end
|
||||||
|
|
||||||
if minetest.setting_getbool("enable_lavacooling") ~= false then
|
if minetest.settings:get_bool("enable_lavacooling") ~= false then
|
||||||
minetest.register_abm({
|
minetest.register_abm({
|
||||||
label = "Lava cooling",
|
label = "Lava cooling",
|
||||||
nodenames = {"default:lava_source", "default:lava_flowing"},
|
nodenames = {"default:lava_source", "default:lava_flowing"},
|
||||||
|
@ -148,7 +148,7 @@ minetest.override_item("default:coalblock", {
|
|||||||
-- Sound
|
-- Sound
|
||||||
--
|
--
|
||||||
|
|
||||||
local flame_sound = minetest.setting_getbool("flame_sound")
|
local flame_sound = minetest.settings:get_bool("flame_sound")
|
||||||
if flame_sound == nil then
|
if flame_sound == nil then
|
||||||
-- Enable if no setting present
|
-- Enable if no setting present
|
||||||
flame_sound = true
|
flame_sound = true
|
||||||
@ -290,10 +290,10 @@ minetest.register_abm({
|
|||||||
|
|
||||||
-- Enable the following ABMs according to 'enable fire' setting
|
-- Enable the following ABMs according to 'enable fire' setting
|
||||||
|
|
||||||
local fire_enabled = minetest.setting_getbool("enable_fire")
|
local fire_enabled = minetest.settings:get_bool("enable_fire")
|
||||||
if fire_enabled == nil then
|
if fire_enabled == nil then
|
||||||
-- enable_fire setting not specified, check for disable_fire
|
-- enable_fire setting not specified, check for disable_fire
|
||||||
local fire_disabled = minetest.setting_getbool("disable_fire")
|
local fire_disabled = minetest.settings:get_bool("disable_fire")
|
||||||
if fire_disabled == nil then
|
if fire_disabled == nil then
|
||||||
-- Neither setting specified, check whether singleplayer
|
-- Neither setting specified, check whether singleplayer
|
||||||
fire_enabled = minetest.is_singleplayer()
|
fire_enabled = minetest.is_singleplayer()
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
local stuff_string = minetest.setting_get("initial_stuff") or
|
local stuff_string = minetest.settings:get("initial_stuff") or
|
||||||
"default:pick_steel,default:axe_steel,default:shovel_steel," ..
|
"default:pick_steel,default:axe_steel,default:shovel_steel," ..
|
||||||
"default:torch 99,default:cobble 99"
|
"default:torch 99,default:cobble 99"
|
||||||
|
|
||||||
@ -39,6 +39,6 @@ function give_initial_stuff.get_list()
|
|||||||
end
|
end
|
||||||
|
|
||||||
give_initial_stuff.add_from_csv(stuff_string)
|
give_initial_stuff.add_from_csv(stuff_string)
|
||||||
if minetest.setting_getbool("give_initial_stuff") then
|
if minetest.settings:get_bool("give_initial_stuff") then
|
||||||
minetest.register_on_newplayer(give_initial_stuff.give)
|
minetest.register_on_newplayer(give_initial_stuff.give)
|
||||||
end
|
end
|
||||||
|
@ -3,7 +3,7 @@ minetest.register_chatcommand("killme", {
|
|||||||
func = function(name)
|
func = function(name)
|
||||||
local player = minetest.get_player_by_name(name)
|
local player = minetest.get_player_by_name(name)
|
||||||
if player then
|
if player then
|
||||||
if minetest.setting_getbool("enable_damage") then
|
if minetest.settings:get_bool("enable_damage") then
|
||||||
player:set_hp(0)
|
player:set_hp(0)
|
||||||
return true
|
return true
|
||||||
else
|
else
|
||||||
|
@ -15,7 +15,7 @@ minetest.register_alias("stairs:slab_pinewood", "stairs:slab_pine_wood")
|
|||||||
|
|
||||||
-- Get setting for replace ABM
|
-- Get setting for replace ABM
|
||||||
|
|
||||||
local replace = minetest.setting_getbool("enable_stairs_replace_abm")
|
local replace = minetest.settings:get_bool("enable_stairs_replace_abm")
|
||||||
|
|
||||||
local function rotate_and_place(itemstack, placer, pointed_thing)
|
local function rotate_and_place(itemstack, placer, pointed_thing)
|
||||||
local p0 = pointed_thing.under
|
local p0 = pointed_thing.under
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
tnt = {}
|
tnt = {}
|
||||||
|
|
||||||
-- Default to enabled when in singleplayer
|
-- Default to enabled when in singleplayer
|
||||||
local enable_tnt = minetest.setting_getbool("enable_tnt")
|
local enable_tnt = minetest.settings:get_bool("enable_tnt")
|
||||||
if enable_tnt == nil then
|
if enable_tnt == nil then
|
||||||
enable_tnt = minetest.is_singleplayer()
|
enable_tnt = minetest.is_singleplayer()
|
||||||
end
|
end
|
||||||
@ -12,7 +12,7 @@ local loss_prob = {}
|
|||||||
loss_prob["default:cobble"] = 3
|
loss_prob["default:cobble"] = 3
|
||||||
loss_prob["default:dirt"] = 4
|
loss_prob["default:dirt"] = 4
|
||||||
|
|
||||||
local tnt_radius = tonumber(minetest.setting_get("tnt_radius") or 3)
|
local tnt_radius = tonumber(minetest.settings:get("tnt_radius") or 3)
|
||||||
|
|
||||||
-- Fill a list with data for content IDs, after all nodes are registered
|
-- Fill a list with data for content IDs, after all nodes are registered
|
||||||
local cid_data = {}
|
local cid_data = {}
|
||||||
|
Loading…
Reference in New Issue
Block a user