Files
Shiroha/shiroha-server/minecraft-patches/features/0081-Gale-Skip-negligible-planar-movement-multiplication.patch
T
NanaChiyo0721 dfe2c124e6
Shiroha CI / build (push) Canceled after 0s
Shiroha CI / Event File (push) Canceled after 0s
Improve entity high velocity fixes
2026-08-14 01:49:37 +08:00

33 lines
1.7 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrHua269 <mrhua269@gmail.com>
Date: Thu, 4 Jun 2026 17:32:39 +0800
Subject: [PATCH] Gale: Skip negligible planar movement multiplication
License: GPL-3.0-only (https://www.gnu.org/licenses/gpl-3.0.html)
Gale - https://github.com/GaleMC/Gale
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
index 4f863e68fb2323a442f868a2531a9eda816a2555..ecd17c6bdf9668842879aa687505afc7c7430dad 100644
--- a/net/minecraft/world/entity/Entity.java
+++ b/net/minecraft/world/entity/Entity.java
@@ -1318,8 +1318,17 @@ public abstract class Entity
}
}
- float blockSpeedFactor = this.getBlockSpeedFactor();
- this.setDeltaMovement(this.getDeltaMovement().multiply(blockSpeedFactor, 1.0, blockSpeedFactor));
+ // Gale start - skip negligible planar movement multiplication
+ Vec3 oldDeltaMovement = this.getDeltaMovement();
+ if (oldDeltaMovement.x < -1e-6 || oldDeltaMovement.x > 1e-6 || oldDeltaMovement.z < -1e-6 || oldDeltaMovement.z > 1e-6) {
+ // Gale end - skip negligible planar movement multiplication
+ float blockSpeedFactor = this.getBlockSpeedFactor();
+ // Gale start - skip negligible planar movement multiplication
+ if (blockSpeedFactor < 1 - 1e-6 || blockSpeedFactor > 1 + 1e-6) {
+ this.setDeltaMovement(oldDeltaMovement.multiply(blockSpeedFactor, 1.0, blockSpeedFactor));
+ }
+ }
+ // Gale end - skip negligible planar movement multiplication
profiler.pop();
}
}