mirror of
https://github.com/BX-Team/DivineMC.git
synced 2025-12-19 14:59:25 +00:00
Upstream has released updates that appear to apply and compile correctly Purpur Changes: PurpurMC/Purpur@11c030a8 Updated Upstream (Paper)
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 02f39e3dc420a5bd49cd6e247c9b1894dc49d303..0171befef713e89d9241c7735d5d285b23373e8f 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");
|
|
@@ -4425,6 +4427,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,
|