Paper/patches/server/0357-Don-t-tick-dead-players.patch

22 lines
1.0 KiB
Diff
Raw Normal View History

2021-06-11 14:02:28 +02:00
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
2023-06-08 00:41:25 +02:00
index 30134138a476716b9dfb82fe0f8b698e1a5ea3a6..b5ce9a93089ea64286bd33cf3fd6eab60863c66d 100644
2021-06-11 14:02:28 +02:00
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
2023-06-08 00:41:25 +02:00
@@ -682,7 +682,7 @@ public class ServerPlayer extends Player {
2021-06-11 14:02:28 +02:00
public void doTick() {
try {
2021-06-14 00:05:18 +02:00
- 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)
2021-06-11 14:02:28 +02:00
super.tick();
}