Files
Shiroha/shiroha-server/minecraft-patches/features/0080-Gale-Skip-negligible-planar-movement-multiplication.patch
T
NanaChiyo0721 1bb895c165
Shiroha CI / build (push) Canceled after 0s
Shiroha CI / Event File (push) Canceled after 0s
Fix incorrect ticket lock size computing
Yeah this would fully solve the issue of chunk unloading race condition

The same fix was already initially added at "Force clamp grid-exponent to 1~6"
2026-08-09 14:57:32 +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 e3f79a6f8489694b1133a611931dcafeb1c79634..c6b2baca40ed2a12cf5ae1032f4f610b335cc5af 100644
--- a/net/minecraft/world/entity/Entity.java
+++ b/net/minecraft/world/entity/Entity.java
@@ -1299,8 +1299,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();
}
}