mirror of
https://github.com/BX-Team/DivineMC.git
synced 2025-12-19 14:59:25 +00:00
I'll make some changes now, so skipping build Changelog: * add CarpetFixes optimizations * fix optimizations config * lithium optimizations * add Carpet Fixes Sheep Optimization * add Async Pathfinding; add C2ME opts math * add 2 vmp patches * New performance patches; update README and wiki README * update configuration on wiki * update wiki main page * Updated Upstream (Purpur) * fix conflicts * make "Don't save Fireworks" patch configurable * Disable memory reserve allocating * Fix MC-172801 * resolve conflicts * add bstats to readme * dd custom list of forks * update logo link
42 lines
2.2 KiB
Diff
42 lines
2.2 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com>
|
|
Date: Fri, 26 Jan 2024 17:42:42 +0300
|
|
Subject: [PATCH] vmp: skip entity move if movement is zero
|
|
|
|
Original code by RelativityMC, licensed under MIT
|
|
You can find the original code on https://github.com/RelativityMC/VMP-fabric (Yarn mappings)
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
|
index 8c605b522f0d452238d9aad8adc875c98235d63d..ac609d0483ca2f6b6eaf96ee48991f48bd774725 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
|
@@ -316,6 +316,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
|
public float yRotO;
|
|
public float xRotO;
|
|
private AABB bb;
|
|
+ private boolean boundingBoxChanged = false; // DivineMC - vmp: skip entity move if movement is zero
|
|
public boolean onGround;
|
|
public boolean horizontalCollision;
|
|
public boolean verticalCollision;
|
|
@@ -1107,6 +1108,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
|
// Paper end - detailed watchdog information
|
|
|
|
public void move(MoverType movementType, Vec3 movement) {
|
|
+ // DivineMC start - vmp: skip entity move if movement is zero
|
|
+ if (!boundingBoxChanged && movement.equals(Vec3.ZERO)) {
|
|
+ boundingBoxChanged = false;
|
|
+ return;
|
|
+ }
|
|
+ // DivineMC end
|
|
final Vec3 originalMovement = movement; // Paper - Expose pre-collision velocity
|
|
// Paper start - detailed watchdog information
|
|
io.papermc.paper.util.TickThread.ensureTickThread("Cannot move an entity off-main");
|
|
@@ -4146,6 +4153,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
|
}
|
|
|
|
public final void setBoundingBox(AABB boundingBox) {
|
|
+ if (!this.bb.equals(boundingBox)) boundingBoxChanged = true; // DivineMC - vmp: skip entity move if movement is zero
|
|
// CraftBukkit start - block invalid bounding boxes
|
|
double minX = boundingBox.minX,
|
|
minY = boundingBox.minY,
|