Elytra moves quicker than mapgen can cope. A bit performance hit on servers. Make this configurable.

This commit is contained in:
ancientmarinerdev 2023-03-30 22:24:42 +01:00 committed by Gitea
parent ed8953dfe3
commit 3e6b43ad47
2 changed files with 21 additions and 8 deletions

View file

@ -22,6 +22,20 @@ local math = math
-- Internal player state -- Internal player state
local mcl_playerplus_internal = {} local mcl_playerplus_internal = {}
-- Could occassionally hit about 4.6 but servers and high power machines struggle to keep up with this.
-- Until mapgen can keep up, it's best to limit for server performance etc.
local elytra_vars = {
slowdown_mult = 0.0, -- amount of vel to take per sec
fall_speed = 0.2, -- amount of vel to fall down per sec
speedup_mult = 2, -- amount of speed to add based on look dir
max_speed = tonumber(minetest.settings:get("mcl_elytra_max_speed")) or 4.0, -- was 6 max amount to multiply against look direction when flying
pitch_penalty = 1.3, -- if pitching up, slow down at this rate as a multiplier
rocket_speed = tonumber(minetest.settings:get("mcl_elytra_rocket_speed")) or 3.5, --was 5.5
}
--minetest.log("action", "elytra_vars.max_speed: " .. dump(elytra_vars.max_speed))
--minetest.log("action", "elytra_vars.rocket_speed: " .. dump(elytra_vars.rocket_speed))
local time = 0 local time = 0
local look_pitch = 0 local look_pitch = 0
@ -136,14 +150,7 @@ local function clamp(num, min, max)
return math.min(max, math.max(num, min)) return math.min(max, math.max(num, min))
end end
local elytra_vars = {
slowdown_mult = 0.0, -- amount of vel to take per sec
fall_speed = 0.2, -- amount of vel to fall down per sec
speedup_mult = 2, -- amount of speed to add based on look dir
max_speed = 6, -- max amount to multiply against look direction when flying
pitch_penalty = 1.3, -- if pitching up, slow down at this rate as a multiplier
rocket_speed = 5.5,
}
local player_props_elytra = { local player_props_elytra = {
collisionbox = { -0.35, 0, -0.35, 0.35, 0.8, 0.35 }, collisionbox = { -0.35, 0, -0.35, 0.35, 0.8, 0.35 },

View file

@ -61,6 +61,12 @@ mcl_playersSleepingPercentage (Players Sleeping Percentage) int 100
# setting, so players always keep their inventory on death. # setting, so players always keep their inventory on death.
mcl_keepInventory (Keep inventory on death) bool false mcl_keepInventory (Keep inventory on death) bool false
# Elytra maximum speed cap
mcl_elytra_max_speed (Elytra maximum speed cap) float 4.0 2.5 6.0
# Elytra rocket speed cap
mcl_elytra_rocket_speed (Elytra rocket speed cap) float 3.5 2.0 5.5
# If enabled, chat messages are shown to everyone when a player dies. # If enabled, chat messages are shown to everyone when a player dies.
mcl_showDeathMessages (Show death messages) bool true mcl_showDeathMessages (Show death messages) bool true