Files
Purpur/patches/server/0052-Fix-the-dead-lagging-the-server.patch
2021-06-02 20:32:18 -05:00

32 lines
1.7 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
Date: Fri, 6 Mar 2020 13:37:26 -0600
Subject: [PATCH] Fix the dead lagging the server
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index f734c79e5ed4fefc1431cb8cadf45572a19a9838..94644c513c92d0dd44592cd70ec36278bc83ac8b 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -1660,6 +1660,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne
this.pitch = MathHelper.a(f1, -90.0F, 90.0F) % 360.0F;
this.lastYaw = this.yaw;
this.lastPitch = this.pitch;
+ if (valid && !dead) world.getChunkAt((int) Math.floor(this.locX()) >> 4, (int) Math.floor(this.locZ()) >> 4); // CraftBukkit // Paper // Purpur
}
public void f(double d0, double d1, double d2) {
diff --git a/src/main/java/net/minecraft/world/entity/EntityLiving.java b/src/main/java/net/minecraft/world/entity/EntityLiving.java
index c2f2b9006dfc8e6d090768c8550ddf42e0e82b80..51f0259d66a82e5cf3a20f1d3994cb2826d1e3d1 100644
--- a/src/main/java/net/minecraft/world/entity/EntityLiving.java
+++ b/src/main/java/net/minecraft/world/entity/EntityLiving.java
@@ -2594,7 +2594,7 @@ public abstract class EntityLiving extends Entity {
}
}
- this.movementTick();
+ if (!dead) this.movementTick(); // Purpur
double d0 = this.locX() - this.lastX;
double d1 = this.locZ() - this.lastZ;
float f = (float) (d0 * d0 + d1 * d1);