38 lines
1.8 KiB
Diff
38 lines
1.8 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: MrHua269 <wangxyper@163.com>
|
|
Date: Sun, 12 Jan 2025 15:35:15 +0800
|
|
Subject: [PATCH] Gale Skip entity move if movement is zero
|
|
|
|
|
|
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
|
index 8ec2b94add58d64d9b83d632427923720ec74990..3ad00cc095588574218ca6d729ead119403202e0 100644
|
|
--- a/net/minecraft/world/entity/Entity.java
|
|
+++ b/net/minecraft/world/entity/Entity.java
|
|
@@ -1104,7 +1104,14 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
|
private volatile boolean preventMoving = false;
|
|
//Luminol end
|
|
|
|
+ private boolean boundingBoxChanged = false; // Gale - VMP - skip entity move if movement is zero
|
|
+
|
|
public void move(MoverType type, Vec3 movement) {
|
|
+ // Gale start - VMP - skip entity move if movement is zero
|
|
+ if (!this.boundingBoxChanged && movement.equals(Vec3.ZERO)) {
|
|
+ return;
|
|
+ }
|
|
+ // Gale end - VMP - skip entity move if movement is zero
|
|
final Vec3 originalMovement = movement; // Paper - Expose pre-collision velocity
|
|
// Paper start - detailed watchdog information
|
|
ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread("Cannot move an entity off-main");
|
|
@@ -5045,6 +5052,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
|
}
|
|
|
|
public final void setBoundingBox(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,
|