aboutsummaryrefslogtreecommitdiffhomepage
path: root/Spigot-Server-Patches/0435-Don-t-tick-dead-players.patch
blob: 7f83b49e23ea475d1c66cf73232fe30473453ed5 (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/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index 415049bb5fdcc5c3edaf71bc8ddc330fe6bbcdb2..a03340ae87bf967895d39bed1767f9753c7f0c60 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -469,7 +469,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();
             }