1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-09-15 18:57:08 +00:00

Add default physics variables

Co-authored-by: Yoruma <168607605+Mahoyomu@users.noreply.github.com>
This commit is contained in:
1F616EMO 2025-06-15 22:59:43 +08:00
parent 29cfb6efff
commit 3118efdf1c
No known key found for this signature in database
GPG key ID: EF52EFA8E05859B2
4 changed files with 45 additions and 0 deletions

View file

@ -0,0 +1,29 @@
-- Minetest: builtin/game/default_physics.lua
-- DEFAULT_PHYSICS variable of a player
core.DEFAULT_PHYSICS = {
speed = 1,
speed_walk = 1,
speed_climb = 1,
speed_crouch = 1,
speed_fast = 1,
jump = 1,
gravity = 1,
liquid_fluidity = 1,
liquid_fluidity_smooth = 1,
liquid_sink = 1,
acceleration_default = 1,
acceleration_air = 1,
acceleration_fast = 1,
sneak = true,
sneak_glitch = false,
new_move = true,
}
core.register_on_joinplayer(function(player)
player:set_physics_override(core.DEFAULT_PHYSICS)
end)

View file

@ -30,6 +30,7 @@ dofile(commonpath .. "chatcommands.lua")
dofile(gamepath .. "chat.lua")
dofile(commonpath .. "information_formspecs.lua")
dofile(gamepath .. "static_spawn.lua")
dofile(gamepath .. "default_physics.lua")
dofile(gamepath .. "detached_inventory.lua")
assert(loadfile(gamepath .. "falling.lua"))(builtin_shared)
dofile(gamepath .. "features.lua")