From 0ef7812813fdaa413c3c3aedd9897311bae2eee8 Mon Sep 17 00:00:00 2001 From: Aikar Date: Thu, 28 May 2020 22:57:27 -0400 Subject: [PATCH] Fix Chunks unloading immediately for priority access - Fixes #3461 Adding a priority ticket was apparently causing the level tracker to immediately unload the chunk. That code is scary --- ...ent-Chunk-Priority-Urgency-System-for-Chunks.patch | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Spigot-Server-Patches/Implement-Chunk-Priority-Urgency-System-for-Chunks.patch b/Spigot-Server-Patches/Implement-Chunk-Priority-Urgency-System-for-Chunks.patch index b55c07d2f7..d996824059 100644 --- a/Spigot-Server-Patches/Implement-Chunk-Priority-Urgency-System-for-Chunks.patch +++ b/Spigot-Server-Patches/Implement-Chunk-Priority-Urgency-System-for-Chunks.patch @@ -133,11 +133,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 ticket1.a(this.currentTick); - if (ticket.b() < j) { -+ if (ticket.getTicketLevel() < j || ticket.getTicketType() == TicketType.URGENT || (ticket.getTicketType() == TicketType.PRIORITY && ticket.getTicketLevel() - ticket.priority < j)) { // Paper - check priority tickets too ++ if (ticket.getTicketLevel() < j) { this.e.b(i, ticket.b(), true); ++ // Paper start - queue update if priority ticket add ++ } else if (ticket.getTicketType() == TicketType.URGENT || ticket.getTicketType() == TicketType.PRIORITY) { ++ PlayerChunk updatingChunk = chunkMap.getUpdatingChunk(i); ++ if (updatingChunk != null) { ++ pendingChunkUpdates.add(updatingChunk); ++ } ++ // Paper end } -@@ -0,0 +0,0 @@ public abstract class ChunkMapDistance { + return ticket == ticket1; // CraftBukkit } private boolean removeTicket(long i, Ticket ticket) { // CraftBukkit - void -> boolean