mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2025-12-19 15:09:25 +00:00
43 lines
2.0 KiB
Diff
43 lines
2.0 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: nostalgic853 <yuu8583@proton.me>
|
|
Date: Mon, 24 Oct 2022 11:01:36 +0800
|
|
Subject: [PATCH] VMP: Skip entity move if no movement
|
|
|
|
Original license: MIT
|
|
Original project: https://github.com/RelativityMC/VMP-fabric
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
|
index fc6d90ec2e12cf5d12c6c0d9a45947218185ef3e..853e96c3f2e4dd5572743154074b770ba9a23aa5 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
|
@@ -398,6 +398,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
|
private UUID originWorld;
|
|
public boolean freezeLocked = false; // Paper - Freeze Tick Lock API
|
|
public boolean collidingWithWorldBorder; // Paper
|
|
+ private boolean boundingBoxChanged = false; // KeYi
|
|
|
|
public void setOrigin(@javax.annotation.Nonnull Location location) {
|
|
this.origin = location.toVector();
|
|
@@ -1034,6 +1035,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
|
// Paper end - detailed watchdog information
|
|
|
|
public void move(MoverType movementType, Vec3 movement) {
|
|
+ // KeYi start
|
|
+ if (!boundingBoxChanged && movement.equals(Vec3.ZERO)) {
|
|
+ boundingBoxChanged = false;
|
|
+ return;
|
|
+ }
|
|
+ // KeYi end
|
|
+
|
|
// Paper start - detailed watchdog information
|
|
io.papermc.paper.util.TickThread.ensureTickThread("Cannot move an entity off-main");
|
|
synchronized (this.posLock) {
|
|
@@ -3824,6 +3832,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
|
}
|
|
|
|
public final void setBoundingBox(AABB boundingBox) {
|
|
+ if (!this.bb.equals(boundingBox)) boundingBoxChanged = true; // KeYi
|
|
// CraftBukkit start - block invalid bounding boxes
|
|
double minX = boundingBox.minX,
|
|
minY = boundingBox.minY,
|