mirror of
https://github.com/Dreeam-qwq/Gale.git
synced 2025-12-19 14:59:29 +00:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@a6e82d90 [ci/skip] Clarify getChunkAtAsyncUrgently javadocs (#12125) PaperMC/Paper@cb25c0cf [ci/skip] Fix annotation fields used in NMS getBukkitEntity (#12120) PaperMC/Paper@00701267 [ci/skip] improvement example in javadoc for DatapackRegistrar (#12122) PaperMC/Paper@608f004a add method on ItemStack to edit pdc (#12022) PaperMC/Paper@7bee9971 Cleanup damage source a bit (#12106) PaperMC/Paper@b9023b5d Add EntityAttemptSmashAttackEvent (#12113) PaperMC/Paper@a3781ff3 Separate tick count to ensure vanilla parity (#12077) PaperMC/Paper@2a4a1154 Add EntityEquipmentChangedEvent (#12011) PaperMC/Paper@06f96dd6 Improvement in /plugins command (#12121) PaperMC/Paper@28d07dc5 use correct spigot plugin count PaperMC/Paper@60394c5b Fix PlayerReadyArrowEvent cancellation desync (#12111) PaperMC/Paper@b27e11cc Fix bad world to chunk coordinate example in javadocs (#12131) PaperMC/Paper@88cdd220 Fixup luck and random implementation in CB loot-tables (#11926) PaperMC/Paper@84609dc0 Don't auto-create any brig redirects (#11954) PaperMC/Paper@8eb8e44a Allow For Default Titles in InventoryView Builders (#12013)
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 9a5bd53aaf02cdbc0d452af3e288a6f56f116ec9..91f414d957e19bd267f1d833b91ec4132e19a8ec 100644
|
|
--- a/net/minecraft/world/entity/Entity.java
|
|
+++ b/net/minecraft/world/entity/Entity.java
|
|
@@ -233,6 +233,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;
|
|
@@ -1080,6 +1081,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");
|
|
@@ -4171,6 +4177,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,
|