43 lines
2.1 KiB
Diff
43 lines
2.1 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: MrHua269 <novau233@163.com>
|
|
Date: Tue, 6 Feb 2024 04:21:05 +0000
|
|
Subject: [PATCH] Gale Skip entity move if movement is zero
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
|
index 485ca9a13a04ee47b27f1d23c6323583139865a1..2072664329f68552f43db55dee283ba96951ac09 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
|
@@ -317,6 +317,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
|
public float yRotO;
|
|
public float xRotO;
|
|
private AABB bb;
|
|
+ private boolean boundingBoxChanged = false; // Gale - VMP - skip entity move if movement is zero
|
|
public boolean onGround;
|
|
public boolean horizontalCollision;
|
|
public boolean verticalCollision;
|
|
@@ -1102,6 +1103,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
|
//Luminol end
|
|
|
|
public void move(MoverType movementType, 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
|
|
io.papermc.paper.util.TickThread.ensureTickThread("Cannot move an entity off-main");
|
|
@@ -4955,6 +4961,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
|
}
|
|
|
|
public final void setBoundingBox(AABB boundingBox) {
|
|
+ // Gale start - VMP - skip entity move if movement is zero
|
|
+ if (!this.bb.equals(boundingBox)) {
|
|
+ this.boundingBoxChanged = true;
|
|
+ }
|
|
+ // Gale end - VMP - skip entity move if movement is zero
|
|
// CraftBukkit start - block invalid bounding boxes
|
|
double minX = boundingBox.minX,
|
|
minY = boundingBox.minY,
|