Paper/Remapped-Spigot-Server-Patches/0424-Don-t-tick-dead-players.patch
2021-06-11 13:56:17 +02:00

22 Zeilen
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/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index a469016c43251f16913a365c4131b2448eaa4c48..286b75a27103a084a9f9d79a90716ebcad65d813 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -606,7 +606,7 @@ public class ServerPlayer extends Player implements ContainerListener {
public void doTick() {
try {
- if (!this.isSpectator() || this.level.hasChunkAt(this.blockPosition())) {
+ if (valid && !this.isSpectator() || this.level.hasChunkAt(this.blockPosition())) { // Paper - don't tick dead players that are not in the world currently (pending respawn)
super.tick();
}