Files
Shiroha/shiroha-server/minecraft-patches/features/0074-Gale-Skip-entity-move-if-movement-is-zero.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

43 lines
2.1 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrHua269 <mrhua269@gmail.com>
Date: Sat, 18 Apr 2026 12:24:51 +0800
Subject: [PATCH] Gale: Skip entity move if movement is zero
Co-authored by: Martijn Muijsers <martijnmuijsers@live.nl>
ishland <ishlandmc@yeah.net>
A part of: Gale (https://github.com/GaleMC/Gale/blob/276e903b2688f23b19bdc8d493c0bf87656d2400/patches/server/0103-Skip-entity-move-if-movement-is-zero.patch)
VMP (https://github.com/RelativityMC/VMP-fabric)
Licensed under: MIT (https://opensource.org/licenses/MIT)
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
index ca042e76eb240e0f772dc39fb6aa41c2ceb19f63..df03f3407dea64c2ed4ace9bac96c4aa8281f25f 100644
--- a/net/minecraft/world/entity/Entity.java
+++ b/net/minecraft/world/entity/Entity.java
@@ -1152,8 +1152,14 @@ public abstract class Entity
private double moveStartY;
private double moveStartZ;
// Paper end - detailed watchdog information
+ private boolean boundingBoxChanged = false; // Gale - VMP - skip entity move if movement is zero
public void move(final MoverType moverType, Vec3 delta) {
+ // Gale start - VMP - skip entity move if movement is zero
+ if (!this.boundingBoxChanged && delta.equals(Vec3.ZERO)) {
+ return;
+ }
+ // Gale end - VMP - skip entity move if movement is zero
final Vec3 originalMovement = delta; // Paper - Expose pre-collision velocity
// Paper start - detailed watchdog information
ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread("Cannot move an entity off-main");
@@ -5528,6 +5534,11 @@ public abstract class Entity
}
public final void setBoundingBox(final AABB bb) {
+ // Gale start - VMP - skip entity move if movement is zero
+ if (!this.bb.equals(bb)) {
+ this.boundingBoxChanged = true;
+ }
+ // Gale end - VMP - skip entity move if movement is zero
// CraftBukkit start - block invalid bounding boxes
double minX = bb.minX,
minY = bb.minY,