mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-30 20:21:41 +01:00
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
This commit is contained in:
parent
8e9b42b127
commit
0ef7812813
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user