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

Method play

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

Plays the SeedQueue#currentEntry and sets it back to null after.

()

Source from the content-addressed store, hash-verified

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}.

Callers 1

playEntryMethod · 0.95

Calls 4

getInstanceMethod · 0.80
getSessionMethod · 0.80
getServerMethod · 0.80

Tested by

no test coverage detected