mirror of
https://github.com/SmallJoker/boost_cart.git
synced 2024-11-13 06:10:20 +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
|
||||
end
|
||||
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
if not minetest.settings:get_bool("creative_mode") then
|
||||
itemstack:take_item()
|
||||
end
|
||||
return itemstack
|
||||
|
|
14
init.lua
14
init.lua
|
@ -3,18 +3,16 @@ boost_cart = {}
|
|||
boost_cart.modpath = minetest.get_modpath("boost_cart")
|
||||
|
||||
|
||||
-- Settings glue for <= 0.4.15
|
||||
local setting_getter = minetest.setting_get
|
||||
if minetest.settings then
|
||||
setting_getter = function (key)
|
||||
return minetest.settings:get(key)
|
||||
end
|
||||
if not minetest.settings then
|
||||
error("[boost_cart] Your Minetest version is no longer supported."
|
||||
.. " (Version <= 0.4.15)")
|
||||
end
|
||||
|
||||
-- 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
|
||||
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
|
||||
if not default.player_attached then
|
||||
|
|
Loading…
Reference in New Issue
Block a user