mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2025-01-09 16:49:35 +01:00
Implement gamerule:minecartMaxSpeed
This commit is contained in:
parent
5fea074f30
commit
53ea4cf04c
2 changed files with 11 additions and 2 deletions
|
@ -1,5 +1,6 @@
|
||||||
local modname = minetest.get_current_modname()
|
local modname = core.get_current_modname()
|
||||||
local modpath = minetest.get_modpath(modname)
|
local modpath = core.get_modpath(modname)
|
||||||
|
local S = core.get_translator(modname)
|
||||||
mcl_minecarts = {}
|
mcl_minecarts = {}
|
||||||
local mod = mcl_minecarts
|
local mod = mcl_minecarts
|
||||||
mcl_minecarts.modpath = modpath
|
mcl_minecarts.modpath = modpath
|
||||||
|
@ -12,6 +13,13 @@ mod.MAX_TRAIN_LENGTH = 4
|
||||||
mod.CART_BLOCK_SIZE = 64
|
mod.CART_BLOCK_SIZE = 64
|
||||||
mod.PASSENGER_ATTACH_POSITION = vector.new(0, -1.75, 0)
|
mod.PASSENGER_ATTACH_POSITION = vector.new(0, -1.75, 0)
|
||||||
|
|
||||||
|
vl_tuning.setting("gamerule:minecartMaxSpeed", "number", {
|
||||||
|
set = function(value) mod.SPEED_MAX = value end,
|
||||||
|
get = function() return mod.SPEED_MAX end,
|
||||||
|
default = 10,
|
||||||
|
description = S("The maximum speed a minecart may reach.")
|
||||||
|
})
|
||||||
|
|
||||||
for _,filename in pairs({"storage","functions","rails","train","carts"}) do
|
for _,filename in pairs({"storage","functions","rails","train","carts"}) do
|
||||||
dofile(modpath.."/"..filename..".lua")
|
dofile(modpath.."/"..filename..".lua")
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
# textdomain: mcl_minecarts
|
# textdomain: mcl_minecarts
|
||||||
##[ carts/minecart.lua ]##
|
##[ carts/minecart.lua ]##
|
||||||
|
The maximum speed a minecart may reach.=
|
||||||
Sneak to dismount=
|
Sneak to dismount=
|
||||||
Minecart=
|
Minecart=
|
||||||
Vehicle for fast travel on rails=
|
Vehicle for fast travel on rails=
|
||||||
|
|
Loading…
Reference in a new issue