|
160 | 160 | if (!TickThread.isTickThread()) { |
161 | 161 | // These will be handled on the next ServerChunkCache$MainThreadExecutor#pollTask, as it runs the distance manager update |
162 | 162 | // which will invoke processTicketUpdates |
163 | | -@@ -1143,94 +_,110 @@ |
| 163 | +@@ -1143,97 +_,116 @@ |
164 | 164 |
|
165 | 165 | private void removeChunkHolder(final NewChunkHolder holder) { |
166 | 166 | holder.onUnload(); |
|
230 | 230 | // We do need to process updates here so that any addTicket that is synchronised before this call does not go missed. |
231 | 231 | this.processTicketUpdates(); |
232 | 232 |
|
233 | | -- final int toUnloadCount = Math.max(50, (int)(unloadCountTentative * 0.05)); |
234 | | -+ final int toUnloadCount = 50; // Math.max(50, (int)(unloadCountTentative * 0.05)); // ShreddedPaper - use our own unload queue |
| 233 | +- final int toUnloadCount = Math.max( |
| 234 | +- PlatformHooks.get().configMinChunkUnloadCount(this.world), |
| 235 | +- (int)Math.round(unloadCountTentative * Math.clamp(PlatformHooks.get().configMinChunkUnloadFraction(this.world), 0.0, 1.0)) |
| 236 | +- ); |
| 237 | ++ // ShreddedPaper start - use our own unload queue |
| 238 | ++ // final int toUnloadCount = Math.max( |
| 239 | ++ // PlatformHooks.get().configMinChunkUnloadCount(this.world), |
| 240 | ++ // (int)Math.round(unloadCountTentative * Math.clamp(PlatformHooks.get().configMinChunkUnloadFraction(this.world), 0.0, 1.0)) |
| 241 | ++ // ); |
| 242 | ++ final int toUnloadCount = 50; |
| 243 | ++ // ShreddedPaper end - use our own unload queue |
235 | 244 | int processedCount = 0; |
236 | 245 |
|
237 | 246 | - for (final ChunkUnloadQueue.SectionToUnload sectionRef : unloadSectionsForRegion) { |
|
334 | 343 |
|
335 | 344 | // run stage 1 |
336 | 345 | for (int i = 0, len = stage1.size(); i < len; ++i) { |
337 | | -@@ -1295,10 +_,12 @@ |
| 346 | +@@ -1298,10 +_,12 @@ |
338 | 347 |
|
339 | 348 | processedCount += stage1.size(); |
340 | 349 |
|
|
351 | 360 | } |
352 | 361 |
|
353 | 362 | public enum TicketOperationType { |
354 | | -@@ -1515,7 +_,7 @@ |
| 363 | +@@ -1518,7 +_,7 @@ |
355 | 364 | public JsonObject getDebugJson() { |
356 | 365 | final JsonObject ret = new JsonObject(); |
357 | 366 |
|
|
0 commit comments