Plays the SeedQueue#currentEntry and sets it back to null after.
()
| 112 | * Plays the {@link SeedQueue#currentEntry} and sets it back to {@code null} after. |
| 113 | */ |
| 114 | private static void play() { |
| 115 | if (!MinecraftClient.getInstance().isOnThread()) { |
| 116 | throw new RuntimeException("Tried to play a SeedQueueEntry off-thread!"); |
| 117 | } |
| 118 | if (currentEntry == null) { |
| 119 | throw new IllegalStateException("Tried to play a SeedQueueEntry but currentEntry is null!"); |
| 120 | } |
| 121 | // standardsettings can cause the current screen to be re-initialized, |
| 122 | // so we open an intermission screen to avoid atum reset logic being called twice |
| 123 | MinecraftClient.getInstance().openScreen(new ProgressScreen()); |
| 124 | MinecraftClient.getInstance().createWorld( |
| 125 | currentEntry.getSession().getDirectoryName(), |
| 126 | currentEntry.getServer().getSaveProperties().getLevelInfo(), |
| 127 | ((MinecraftServerAccessor) currentEntry.getServer()).seedQueue$getDimensionTracker(), |
| 128 | currentEntry.getServer().getSaveProperties().getGeneratorOptions() |
| 129 | ); |
| 130 | currentEntry = null; |
| 131 | } |
| 132 | |
| 133 | /** |
| 134 | * Traverses the queue in order and returns the first {@link SeedQueueEntry} matching the {@link Predicate}. |
no test coverage detected