forked from Mirrorlandia_minetest/mod-sneeker
Replace deprecated methods:
- 'setting_get' with 'settings:get' - 'setting_getbool' with 'settings:get_bool'
This commit is contained in:
parent
9e1b11a52c
commit
8d144e47db
@ -1,7 +1,7 @@
|
|||||||
-- Functions for sneeker mod
|
-- Functions for sneeker mod
|
||||||
|
|
||||||
|
|
||||||
local log_mods = minetest.setting_getbool('log_mods')
|
local log_mods = minetest.settings:get_bool('log_mods')
|
||||||
|
|
||||||
|
|
||||||
-- Displays a message in log output
|
-- Displays a message in log output
|
||||||
|
4
init.lua
4
init.lua
@ -5,7 +5,7 @@ sneeker = {}
|
|||||||
sneeker.modname = minetest.get_current_modname()
|
sneeker.modname = minetest.get_current_modname()
|
||||||
sneeker.modpath = minetest.get_modpath(sneeker.modname)
|
sneeker.modpath = minetest.get_modpath(sneeker.modname)
|
||||||
|
|
||||||
if minetest.setting_getbool('log_mods') then
|
if minetest.settings:get_bool('log_mods') then
|
||||||
minetest.log('action', 'Loading mod "' .. sneeker.modname .. '" ...')
|
minetest.log('action', 'Loading mod "' .. sneeker.modname .. '" ...')
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -353,7 +353,7 @@ if minetest.get_modpath('spawneggs') and minetest.get_modpath('tnt') then
|
|||||||
local pos = pointed_thing.above
|
local pos = pointed_thing.above
|
||||||
pos.y = pos.y+1
|
pos.y = pos.y+1
|
||||||
minetest.add_entity(pos, sneeker.mob_name)
|
minetest.add_entity(pos, sneeker.mob_name)
|
||||||
if not minetest.setting_getbool('creative_mode') then
|
if not minetest.settings:get_bool('creative_mode') then
|
||||||
itemstack:take_item()
|
itemstack:take_item()
|
||||||
end
|
end
|
||||||
return itemstack
|
return itemstack
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
-- Settings for sneeker mod
|
-- Settings for sneeker mod
|
||||||
|
|
||||||
|
|
||||||
sneeker.debug = minetest.setting_getbool('sneeker.debug') or false
|
sneeker.debug = minetest.settings:get_bool('sneeker.debug') or false
|
||||||
|
@ -5,10 +5,10 @@ local time_min = 60
|
|||||||
local time_hr = time_min * 60
|
local time_hr = time_min * 60
|
||||||
local time_day = time_hr * 24
|
local time_day = time_hr * 24
|
||||||
|
|
||||||
local spawn_cap = tonumber(minetest.setting_get('sneeker.spawn_cap')) or 10 -- Maximum number of spawns active at one time
|
local spawn_cap = tonumber(minetest.settings:get('sneeker.spawn_cap')) or 10 -- Maximum number of spawns active at one time
|
||||||
local spawn_chance = tonumber(minetest.setting_get('sneeker.spawn_chance')) or 1000 -- 1/1000 chance of spawn
|
local spawn_chance = tonumber(minetest.settings:get('sneeker.spawn_chance')) or 1000 -- 1/1000 chance of spawn
|
||||||
local spawn_interval = tonumber(minetest.setting_get('sneeker.spawn_interval')) or time_min * 4 -- Default interval is 4 minutes
|
local spawn_interval = tonumber(minetest.settings:get('sneeker.spawn_interval')) or time_min * 4 -- Default interval is 4 minutes
|
||||||
local spawn_maxlight = tonumber(minetest.setting_get('sneeker.spawn_maxlight')) or 5 -- Maximum light of node for spawn
|
local spawn_maxlight = tonumber(minetest.settings:get('sneeker.spawn_maxlight')) or 5 -- Maximum light of node for spawn
|
||||||
|
|
||||||
local spawn_chance_percent = tostring(math.floor(1 / spawn_chance * 100)) .. '%'
|
local spawn_chance_percent = tostring(math.floor(1 / spawn_chance * 100)) .. '%'
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
-- From TNT
|
-- From TNT
|
||||||
local cid_data = {}
|
local cid_data = {}
|
||||||
local radius = tonumber(minetest.setting_get('tnt_radius') or 3)
|
local radius = tonumber(minetest.settings:get('tnt_radius') or 3)
|
||||||
local large_radius = 5
|
local large_radius = 5
|
||||||
local loss_prob = {
|
local loss_prob = {
|
||||||
['default:cobble'] = 3,
|
['default:cobble'] = 3,
|
||||||
|
Loading…
Reference in New Issue
Block a user