mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2025-12-19 15:09:25 +00:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@a9399451 Fixup sendAllDataToRemote calls PaperMC/Paper@cb47e018 Remove more dead code, fix pre-existing desync when cancelling and closing container PaperMC/Paper@40764534 Specify the class loader when loading services (#12829) PaperMC/Paper@1bf6364b Update Mache for horse decompile fix PaperMC/Paper@76fb5060 Add vanilla error message to precondition for DialogBaseImpl (#12831) Purpur Changes: PurpurMC/Purpur@5b26bab8 Updated Upstream (Paper) PurpurMC/Purpur@8734844b sigh... PurpurMC/Purpur@09ea9cb9 fix mobs not burning in daylight (#1689) PurpurMC/Purpur@4d5a8e6e Updated Upstream (Paper) PurpurMC/Purpur@7dbe4153 Add support for "/chase", a disabled Minecraft command. (#1690) PurpurMC/Purpur@11c030a8 Updated Upstream (Paper)
51 lines
2.4 KiB
Diff
51 lines
2.4 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Martijn Muijsers <martijnmuijsers@live.nl>
|
|
Date: Wed, 30 Nov 2022 14:25:58 +0100
|
|
Subject: [PATCH] Skip entity move if movement is zero
|
|
|
|
License: MIT (https://opensource.org/licenses/MIT)
|
|
Gale - https://galemc.org
|
|
|
|
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 ab6abe703c3df6908c8001fc81efe2dca062eba1..9b81d49b6a6a93019100416c21ba8c732203395e 100644
|
|
--- a/net/minecraft/world/entity/Entity.java
|
|
+++ b/net/minecraft/world/entity/Entity.java
|
|
@@ -260,6 +260,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
|
public float yRotO;
|
|
public float xRotO;
|
|
private AABB bb = INITIAL_AABB;
|
|
+ private boolean boundingBoxChanged = false; // Gale - VMP - skip entity move if movement is zero
|
|
public boolean onGround;
|
|
public boolean horizontalCollision;
|
|
public boolean verticalCollision;
|
|
@@ -1086,6 +1087,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
|
// Paper end - detailed watchdog information
|
|
|
|
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");
|
|
@@ -4375,6 +4381,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,
|