mirror of
https://github.com/PaperMC/Paper.git
synced 2025-03-13 19:28:03 +01:00
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
This commit is contained in:
parent
57802a490d
commit
b7898433d0
1 changed files with 8 additions and 3 deletions
|
@ -100,14 +100,19 @@
|
|||
}
|
||||
|
||||
private SortedArraySet<Ticket<?>> getTickets(long position) {
|
||||
@@ -253,6 +279,7 @@
|
||||
@@ -253,9 +279,10 @@
|
||||
ChunkPos chunkcoordintpair = pos.chunk();
|
||||
long i = chunkcoordintpair.toLong();
|
||||
ObjectSet<ServerPlayer> objectset = (ObjectSet) this.playersPerChunk.get(i);
|
||||
+ if (objectset == null) return; // CraftBukkit - SPIGOT-6208
|
||||
|
||||
objectset.remove(player);
|
||||
if (objectset.isEmpty()) {
|
||||
- objectset.remove(player);
|
||||
- if (objectset.isEmpty()) {
|
||||
+ if (objectset != null) objectset.remove(player); // Paper - some state corruption happens here, don't crash, clean up gracefully
|
||||
+ if (objectset == null || objectset.isEmpty()) { // Paper
|
||||
this.playersPerChunk.remove(i);
|
||||
this.naturalSpawnChunkCounter.update(i, Integer.MAX_VALUE, false);
|
||||
this.playerTicketManager.update(i, Integer.MAX_VALUE, false);
|
||||
@@ -358,7 +385,7 @@
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue