mirror of
https://github.com/Splizard/minetest-mod-snow.git
synced 2024-12-28 23:40:17 +01:00
Use new setting functions
This commit is contained in:
parent
f7b048a851
commit
812b0f977e
@ -6,13 +6,13 @@
|
|||||||
-- Quite a bit of trial-and-error learning here and it boiled down to a
|
-- Quite a bit of trial-and-error learning here and it boiled down to a
|
||||||
-- small handful of code lines making the difference. ~ LazyJ
|
-- 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 snowball_velocity, entity_attack_delay
|
||||||
local function update_snowball_vel(v)
|
local function update_snowball_vel(v)
|
||||||
snowball_velocity = 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
|
entity_attack_delay = (walkspeed+1)/v
|
||||||
end
|
end
|
||||||
update_snowball_vel(snow.snowball_velocity)
|
update_snowball_vel(snow.snowball_velocity)
|
||||||
@ -27,7 +27,7 @@ snow.register_on_configuring(function(name, v)
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
local function get_gravity()
|
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
|
return grav*snowball_gravity
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ There is one in each of the "stairsplus.register_all" sections.
|
|||||||
|
|
||||||
-- Check for infinite stacks
|
-- 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
|
-- snow_stairsplus.expect_infinite_stacks = false
|
||||||
--else
|
--else
|
||||||
-- snow_stairsplus.expect_infinite_stacks = true
|
-- snow_stairsplus.expect_infinite_stacks = true
|
||||||
|
@ -132,7 +132,7 @@ end
|
|||||||
|
|
||||||
for i,v in pairs(snow) do
|
for i,v in pairs(snow) do
|
||||||
if allowed_types[type(v)] then
|
if allowed_types[type(v)] then
|
||||||
local v = minetest.setting_get("snow_"..i)
|
local v = minetest.settings:get("snow_"..i)
|
||||||
if v ~= nil then
|
if v ~= nil then
|
||||||
snow[i] = value_from_string(v)
|
snow[i] = value_from_string(v)
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user