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!
()
| 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. |
no test coverage detected