mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-01 17:01:56 +01:00
bfe5d554d3
There is some vanilla level bug where this tracking state appears to get messed up and player doesn't exists in chunk its trying to untrack. We returned early to prevent crashing, but I suspect if there was a level being tracked for the chunk, it got leaked due to the early return. So going to ensure we clean up the level tracker when this state occurs. This may help with any leaked chunk issues.
23 lines
1.2 KiB
Diff
23 lines
1.2 KiB
Diff
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/ChunkMapDistance.java b/src/main/java/net/minecraft/server/ChunkMapDistance.java
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/net/minecraft/server/ChunkMapDistance.java
|
|
+++ b/src/main/java/net/minecraft/server/ChunkMapDistance.java
|
|
@@ -0,0 +0,0 @@ public abstract class ChunkMapDistance {
|
|
long i = sectionposition.u().pair();
|
|
ObjectSet<EntityPlayer> objectset = (ObjectSet) this.c.get(i);
|
|
|
|
- objectset.remove(entityplayer);
|
|
- if (objectset.isEmpty()) {
|
|
+ if (objectset != null) objectset.remove(entityplayer); // Paper - some state corruption happens here, don't crash, clean up gracefully.
|
|
+ if (objectset == null || objectset.isEmpty()) { // Paper
|
|
this.c.remove(i);
|
|
this.f.b(i, Integer.MAX_VALUE, false);
|
|
this.g.b(i, Integer.MAX_VALUE, false);
|