mirror of
https://github.com/BX-Team/DivineMC.git
synced 2025-12-24 01:09:29 +00:00
40 lines
2.2 KiB
Diff
40 lines
2.2 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com>
|
|
Date: Sun, 6 Jul 2025 02:30:53 +0300
|
|
Subject: [PATCH] VMP: skip entity move if movement is zero
|
|
|
|
This patch is based on the following mixin:
|
|
"com/ishland/vmp/mixins/entity/move_zero_velocity/MixinEntity.java"
|
|
By: ishland <ishlandmc@yeah.net>
|
|
As part of: 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 f8b37b4ce54afd61a72e9d18ac323540431c655d..54307d5795d3cf36c3a39ff7fd21c92b46626c17 100644
|
|
--- a/net/minecraft/world/entity/Entity.java
|
|
+++ b/net/minecraft/world/entity/Entity.java
|
|
@@ -372,6 +372,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
|
public boolean isTemporarilyActive;
|
|
public long activatedImmunityTick = Integer.MIN_VALUE;
|
|
public @Nullable Boolean immuneToFire = null; // Purpur - Fire immune API
|
|
+ private boolean boundingBoxChanged = false; // DivineMC - VMP: skip entity move if movement is zero
|
|
|
|
public void inactiveTick() {
|
|
}
|
|
@@ -1119,6 +1120,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
|
// Paper end - detailed watchdog information
|
|
|
|
public void move(MoverType type, Vec3 movement) {
|
|
+ if (!this.boundingBoxChanged && movement.equals(Vec3.ZERO)) return; // DivineMC - 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");
|
|
@@ -4426,6 +4428,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
|
}
|
|
|
|
public final void setBoundingBox(AABB bb) {
|
|
+ if (!this.bb.equals(bb)) this.boundingBoxChanged = true; // DivineMC - VMP: skip entity move if movement is zero
|
|
// CraftBukkit start - block invalid bounding boxes
|
|
double minX = bb.minX,
|
|
minY = bb.minY,
|