MCPcopy Create free account
hub / github.com/contariaa/seedqueue / clear

Method clear

src/main/java/me/contaria/seedqueue/SeedQueue.java:376–404  ·  view source on GitHub ↗

Clears the queue and discards all the active SeedQueueEntry's. Also clears any other resources like caches and the Wall Screen WorldRenderers.

()

Source from the content-addressed store, hash-verified

374 * Also clears any other resources like caches and the Wall Screen WorldRenderers.
375 */
376 private static void clear() {
377 LOGGER.info("Clearing SeedQueue...");
378
379 Screen screen = MinecraftClient.getInstance().currentScreen;
380 MinecraftClient.getInstance().setScreenAndRender(new SaveLevelScreen(TextUtil.translatable("seedqueue.menu.clearing")));
381
382 synchronized (LOCK) {
383 if (currentEntry != null && !currentEntry.isLoaded()) {
384 currentEntry.discard();
385 }
386 currentEntry = null;
387 }
388
389 SEED_QUEUE.forEach(SeedQueueEntry::discard);
390
391 while (!SEED_QUEUE.isEmpty()) {
392 ((MinecraftClientAccessor) MinecraftClient.getInstance()).seedQueue$render(false);
393 SEED_QUEUE.removeIf(entry -> entry.getServer().isStopping());
394 }
395
396 SeedQueueExecutorWrapper.shutdownExecutors();
397 SeedQueueWallScreen.clearWorldRenderers();
398 ModCompat.worldpreview$clearFramebufferPool();
399 ModCompat.sodium$clearShaderCache();
400 ModCompat.sodium$clearBuildBufferPool();
401 System.gc();
402
403 MinecraftClient.getInstance().openScreen(screen);
404 }
405
406 /**
407 * @return True if there is a running {@link SeedQueueThread}.

Callers 12

stopMethod · 0.95
fromJsonMethod · 0.80
clearFramebufferPoolMethod · 0.80
clearShaderCacheMethod · 0.80
clearBuildBufferPoolMethod · 0.80
buildChunksMethod · 0.80
setOrthoMethod · 0.80
resetAllInstancesMethod · 0.80
startBenchmarkMethod · 0.80
removedMethod · 0.80
clearWorldRenderersMethod · 0.80

Calls 10

shutdownExecutorsMethod · 0.95
clearWorldRenderersMethod · 0.95
getInstanceMethod · 0.80
isLoadedMethod · 0.80
seedQueue$renderMethod · 0.80
getServerMethod · 0.80
discardMethod · 0.45

Tested by

no test coverage detected