2021-06-11 14:02:28 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Aikar <aikar@aikar.co>
|
|
|
|
Date: Sat, 18 Apr 2020 15:59:41 -0400
|
|
|
|
Subject: [PATCH] Don't crash if player is attempted to be removed from
|
|
|
|
untracked chunk.
|
|
|
|
|
|
|
|
I suspect it deals with teleporting as it uses players current x/y/z
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/level/DistanceManager.java b/src/main/java/net/minecraft/server/level/DistanceManager.java
|
2024-12-03 19:21:12 +01:00
|
|
|
index e7bca3db8c7d29fe984decddda83569ef921cc31..c24644d5a77d87ae6c139f9598feafea308f2158 100644
|
2021-06-11 14:02:28 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/level/DistanceManager.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/level/DistanceManager.java
|
2024-10-23 16:04:01 +02:00
|
|
|
@@ -281,8 +281,8 @@ public abstract class DistanceManager {
|
2021-06-11 14:02:28 +02:00
|
|
|
ObjectSet<ServerPlayer> objectset = (ObjectSet) this.playersPerChunk.get(i);
|
|
|
|
if (objectset == null) return; // CraftBukkit - SPIGOT-6208
|
|
|
|
|
|
|
|
- objectset.remove(player);
|
|
|
|
- if (objectset.isEmpty()) {
|
2024-01-21 12:11:43 +01:00
|
|
|
+ if (objectset != null) objectset.remove(player); // Paper - some state corruption happens here, don't crash, clean up gracefully
|
2021-06-11 14:02:28 +02:00
|
|
|
+ if (objectset == null || objectset.isEmpty()) { // Paper
|
|
|
|
this.playersPerChunk.remove(i);
|
|
|
|
this.naturalSpawnChunkCounter.update(i, Integer.MAX_VALUE, false);
|
2024-01-24 13:07:40 +01:00
|
|
|
this.playerTicketManager.update(i, Integer.MAX_VALUE, false);
|