2026-07-09 00:03:09 +08:00
|
|
|
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
|
2026-08-14 01:49:37 +08:00
|
|
|
index 4f863e68fb2323a442f868a2531a9eda816a2555..ecd17c6bdf9668842879aa687505afc7c7430dad 100644
|
2026-07-09 00:03:09 +08:00
|
|
|
--- a/net/minecraft/world/entity/Entity.java
|
|
|
|
|
+++ b/net/minecraft/world/entity/Entity.java
|
2026-08-14 01:49:37 +08:00
|
|
|
@@ -1318,8 +1318,17 @@ public abstract class Entity
|
2026-07-09 00:03:09 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- 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();
|
|
|
|
|
}
|
|
|
|
|
}
|