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 fea2e2005..19a19abb7 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 @@ -687,7 +687,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + + private int getNeighborsPriority() { -+ return neighborPriorities.isEmpty() ? getMyPriority() : getDemandedPriority(); ++ return (neighborPriorities.isEmpty() ? getMyPriority() : getDemandedPriority()) + 1; + } + + public void onNeighborRequest(PlayerChunk neighbor, ChunkStatus status) { diff --git a/Spigot-Server-Patches/Optimize-Light-Engine.patch b/Spigot-Server-Patches/Optimize-Light-Engine.patch index a550c9796..2c0266983 100644 --- a/Spigot-Server-Patches/Optimize-Light-Engine.patch +++ b/Spigot-Server-Patches/Optimize-Light-Engine.patch @@ -1098,7 +1098,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + this.priorityChanges.add(() -> { + ChunkLightQueue remove = this.buckets[currentPriority].remove(pair); + if (remove != null) { -+ ChunkLightQueue existing = this.buckets[priority].put(pair, remove); ++ ChunkLightQueue existing = this.buckets[Math.max(1, priority)].put(pair, remove); + if (existing != null) { + remove.pre.addAll(existing.pre); + remove.post.addAll(existing.post); @@ -1151,12 +1151,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + boolean hasWork = false; + Long2ObjectLinkedOpenHashMap[] buckets = this.buckets; -+ int lowestPriority = 0; -+ while (lowestPriority < MAX_PRIORITIES && !isEmpty()) { -+ Long2ObjectLinkedOpenHashMap bucket = buckets[lowestPriority]; ++ int priority = 0; ++ while (priority < MAX_PRIORITIES && !isEmpty()) { ++ Long2ObjectLinkedOpenHashMap bucket = buckets[priority]; + if (bucket.isEmpty()) { -+ lowestPriority++; -+ if (hasWork && lowestPriority <= 5) { ++ priority++; ++ if (hasWork) { + return true; + } else { + continue;