aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0340-Don-t-tick-dead-players.patch
blob: 742fc27e7889986a098f481e263542adf5952416 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 9f88d1771cefc4700911f1cd9841eb80fc7278a4..74e8aef45702eef0dcabc7841a7c7125cc066cbe 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -748,7 +748,7 @@ public class ServerPlayer extends Player {
 
     public void doTick() {
         try {
-            if (!this.isSpectator() || !this.touchingUnloadedChunk()) {
+            if (valid && !this.isSpectator() || !this.touchingUnloadedChunk()) { // Paper - don't tick dead players that are not in the world currently (pending respawn)
                 super.tick();
             }