✈️ 飛行速度動力學 (Minecraft 26.2)
📌 存放庫原始碼免責聲明:本 Wiki 中的文件反映了存放庫中的當前原始碼狀態,可能包含領先於 CurseForge 與 Modrinth 上公開版本的近期未發布提交或開發特性。
📋 Technical Infobox
| Specification | Technical Details |
|---|---|
| System Architecture | Server-Authoritative Abilities Pipeline + Permille Multiplier |
| Vanilla Baseline Speed | $0.05\text{ blocks/tick}$ ($1.0\text{ blocks/second}$ base flying speed) |
| Controlling GameRules | vo_creative_fly_speed, vo_spectator_fly_speed |
| Unit Scale | Permille ($1000 = 1.0\times$ vanilla, $2500 = 2.5\times$, $10000 = 10.0\times$) |
| Epsilon Drift Guard | $\Delta \le 10^{-6}\text{ F}$ (Prevents packet spam on steady ticks) |
| Target Minecraft Version | 26.2 |
📐 Mathematical Formulation
1. Flying Speed Multiplier Equation
The target flight speed $V_{\text{fly}$ is derived from the configured permille value $P$:
$$V_{\text{fly} = 0.05 \times \frac{P}{1000.0}$$
Where:
- $P = 1000 \implies V_{\text{fly} = 0.05$ (Vanilla baseline: $1.0\times$)
- $P = 2000 \implies V_{\text{fly} = 0.10$ ($2.0\times$ speed)
- $P = 5000 \implies V_{\text{fly} = 0.25$ ($5.0\times$ speed)
- $P = 20000 \implies V_{\text{fly} = 1.00$ ($20.0\times$ speed)
2. Zero-Packet Network Epsilon Guard
To eliminate network packet spam and bandwidth waste during flight: $$\Delta = |V_{\text{current} - V_{\text{fly}|$$ Network synchronization packet ClientboundPlayerAbilitiesPacket is dispatched if and only if: $$\Delta > 10^{-6}\text{ F}$$
java
if (Math.abs(abilities.getFlyingSpeed() - targetSpeed) > 1e-6F) {
abilities.setFlyingSpeed(targetSpeed);
player.onUpdateAbilities();
}🎮 Gamemode State Separation
| Gamemode | Controlling GameRule | Default Value | Notes |
|---|---|---|---|
| Creative Mode | vo_creative_fly_speed | 1000 | Applied strictly when gameMode.isCreative() is true. |
| Spectator Mode | vo_spectator_fly_speed | 1000 | Applied strictly when gameMode.isSpectator() is true. |
| Survival / Adventure | None | N/A | Untouched; retains vanilla gravity and movement constraints. |
