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

Method stop

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

If SeedQueue is active, stops the current SeedQueue session. This stops the active SeedQueueThread and clears the queue and any caches. This method may only be called from the Render Thread!

()

Source from the content-addressed store, hash-verified

345 * This method may only be called from the Render Thread!
346 */
347 public static void stop() {
348 if (!MinecraftClient.getInstance().isOnThread()) {
349 throw new RuntimeException("Tried to stop SeedQueue off-thread!");
350 }
351
352 if (thread == null) {
353 return;
354 }
355
356 LOGGER.info("Stopping SeedQueue...");
357
358 thread.stopQueue();
359 thread.ping();
360 try {
361 thread.join();
362 } catch (InterruptedException e) {
363 throw new RuntimeException("Failed to stop SeedQueue Thread!", e);
364 }
365 thread = null;
366
367 SeedQueueWatchdog.stop();
368
369 clear();
370 }
371
372 /**
373 * Clears the queue and discards all the active {@link SeedQueueEntry}'s.

Callers 3

shutdownQueueMethod · 0.95
shutdownQueueOnCrashMethod · 0.95

Calls 5

stopMethod · 0.95
clearMethod · 0.95
getInstanceMethod · 0.80
stopQueueMethod · 0.80
pingMethod · 0.45

Tested by

no test coverage detected