Files
Purpur/patches/server/0053-Fix-the-dead-lagging-the-server.patch
William Blake Galbreath 444413bba6 Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
5059ada Move log message for named entity deaths into correct location (#6105)
b5be382 Add methods to ProtoWorld for working with BlockStates (#5929)
144e5f7 Add option for logging named entity deaths (#6107)
4aef035 [ci skip] Use Java toolchain for run tasks (#6108)
dafc064 Fix MobEffectArgument#getEffect reobf
648f607 Route sign run_command click events through normal chat logic (#6109)
351a2c3 Drop no longer needed patch (#6115)
bb44da8 Fix cancelling EntityPickupItemEvent for villagers (#6091)
2021-07-07 14:51: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 a12fcb4be21f32933cee916c863d6637ad87ef15..8197ad7db6ec1a750b732e597af75f41ab056778 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -1735,6 +1735,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
this.setXRot(Mth.clamp(pitch, -90.0F, 90.0F) % 360.0F);
this.yRotO = this.getYRot();
this.xRotO = this.getXRot();
+ if (valid && !this.isRemoved()) level.getChunk((int) Math.floor(this.getX()) >> 4, (int) Math.floor(this.getZ()) >> 4); // CraftBukkit // Paper // Purpur
}
public void absMoveTo(double x, double y, double z) {
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index a88b37884e564303a86422cf50faadaf41b9d3f3..df6e71ee5b151b0b319defb4b9fd10858ff03bbd 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -2883,7 +2883,7 @@ public abstract class LivingEntity extends Entity {
}
}
- this.aiStep();
+ if (!this.isRemoved()) this.aiStep(); // Purpur
double d0 = this.getX() - this.xo;
double d1 = this.getZ() - this.zo;
float f = (float) (d0 * d0 + d1 * d1);