Paper/Spigot-Server-Patches/0426-Don-t-tick-dead-players.patch
Mariell Hoversholm 0f78e95250 More work
2021-03-18 18:03:22 +01:00

22 lines
1.1 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Thu, 2 Apr 2020 17:16:48 -0400
Subject: [PATCH] Don't tick dead players
Causes sync chunk loads and who knows what all else.
This is safe because Spectators are skipped in unloaded chunks too in vanilla.
diff --git a/src/main/java/net/minecraft/server/level/EntityPlayer.java b/src/main/java/net/minecraft/server/level/EntityPlayer.java
index 84b0f40edaff726e63f16611b364a692b332ae2b..da16b5773e182a10dca8c91b53b9aba7e924d22b 100644
--- a/src/main/java/net/minecraft/server/level/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/level/EntityPlayer.java
@@ -608,7 +608,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
public void playerTick() {
try {
- if (!this.isSpectator() || this.world.isLoaded(this.getChunkCoordinates())) {
+ if (valid && !this.isSpectator() || this.world.isLoaded(this.getChunkCoordinates())) { // Paper - don't tick dead players that are not in the world currently (pending respawn)
super.tick();
}