mirror of
https://github.com/SmallJoker/boost_cart.git
synced 2024-12-25 02:10:19 +01:00
Remove settings legacy, require 0.4.15-dev or newer
This commit is contained in:
parent
e8119a63cd
commit
2229ededa5
@ -376,7 +376,7 @@ if not boost_cart.mtg_compat then
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
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
|
||||||
|
14
init.lua
14
init.lua
@ -3,18 +3,16 @@ boost_cart = {}
|
|||||||
boost_cart.modpath = minetest.get_modpath("boost_cart")
|
boost_cart.modpath = minetest.get_modpath("boost_cart")
|
||||||
|
|
||||||
|
|
||||||
-- Settings glue for <= 0.4.15
|
if not minetest.settings then
|
||||||
local setting_getter = minetest.setting_get
|
error("[boost_cart] Your Minetest version is no longer supported."
|
||||||
if minetest.settings then
|
.. " (Version <= 0.4.15)")
|
||||||
setting_getter = function (key)
|
|
||||||
return minetest.settings:get(key)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Maximal speed of the cart in m/s
|
-- Maximal speed of the cart in m/s
|
||||||
boost_cart.speed_max = tonumber(setting_getter("boost_cart.speed_max")) or 10
|
boost_cart.speed_max = tonumber(minetest.settings:get("boost_cart.speed_max")) or 10
|
||||||
-- Set to -1 to disable punching the cart from inside
|
-- Set to -1 to disable punching the cart from inside
|
||||||
boost_cart.punch_speed_max = tonumber(setting_getter("boost_cart.punch_speed_max")) or 7
|
boost_cart.punch_speed_max =
|
||||||
|
tonumber(minetest.settings:get("boost_cart.punch_speed_max")) or 7
|
||||||
|
|
||||||
-- Support for non-default games
|
-- Support for non-default games
|
||||||
if not default.player_attached then
|
if not default.player_attached then
|
||||||
|
Loading…
Reference in New Issue
Block a user