Paper/CraftBukkit-Patches/0013-Skip-entity.move-if-we-are-not-moving-anywhere.patch
2013-04-10 14:06:41 +10:00

25 lines
881 B
Diff

From 460f7249412d2a51f500ed8e307e2e3596a03759 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sat, 19 Jan 2013 01:11:30 -0500
Subject: [PATCH] Skip entity.move() if we are not moving anywhere.
---
src/main/java/net/minecraft/server/Entity.java | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 7890d6f..8e743ec 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -430,6 +430,7 @@ public abstract class Entity {
}
public void move(double d0, double d1, double d2) {
+ if (d0 == 0 && d1 == 0 && d2 == 0) { return; } // Spigot
if (this.Z) {
this.boundingBox.d(d0, d1, d2);
this.locX = (this.boundingBox.a + this.boundingBox.d) / 2.0D;
--
1.8.2.1