diff --git a/src/main/java/xyz/nucleoid/fantasy/RuntimeWorld.java b/src/main/java/xyz/nucleoid/fantasy/RuntimeWorld.java index 5243186..44318a5 100644 --- a/src/main/java/xyz/nucleoid/fantasy/RuntimeWorld.java +++ b/src/main/java/xyz/nucleoid/fantasy/RuntimeWorld.java @@ -32,7 +32,7 @@ protected RuntimeWorld(MinecraftServer server, RegistryKey registryKey, R new RuntimeWorldProperties(server.getSaveProperties(), config), registryKey, config.createDimensionOptions(server), - VoidWorldProgressListener.INSTANCE, + config.getWorldGenerationProgressListener(), false, BiomeAccess.hashSeed(config.getSeed()), ImmutableList.of(), @@ -43,7 +43,6 @@ protected RuntimeWorld(MinecraftServer server, RegistryKey registryKey, R this.flat = config.isFlat().orElse(super.isFlat()); } - protected RuntimeWorld(MinecraftServer server, Executor workerExecutor, LevelStorage.Session session, ServerWorldProperties properties, RegistryKey worldKey, DimensionOptions dimensionOptions, WorldGenerationProgressListener worldGenerationProgressListener, boolean debugWorld, long seed, List spawners, boolean shouldTickTime, @Nullable RandomSequencesState randomSequencesState, Style style) { super(server, workerExecutor, session, properties, worldKey, dimensionOptions, worldGenerationProgressListener, debugWorld, seed, spawners, shouldTickTime, randomSequencesState); this.style = style; diff --git a/src/main/java/xyz/nucleoid/fantasy/RuntimeWorldConfig.java b/src/main/java/xyz/nucleoid/fantasy/RuntimeWorldConfig.java index fd5551a..659107c 100644 --- a/src/main/java/xyz/nucleoid/fantasy/RuntimeWorldConfig.java +++ b/src/main/java/xyz/nucleoid/fantasy/RuntimeWorldConfig.java @@ -6,6 +6,7 @@ import net.minecraft.registry.RegistryKeys; import net.minecraft.registry.entry.RegistryEntry; import net.minecraft.server.MinecraftServer; +import net.minecraft.server.WorldGenerationProgressListener; import net.minecraft.world.Difficulty; import net.minecraft.world.GameRules; import net.minecraft.world.dimension.DimensionOptions; @@ -13,6 +14,7 @@ import net.minecraft.world.gen.chunk.ChunkGenerator; import org.jetbrains.annotations.Nullable; import xyz.nucleoid.fantasy.util.GameRuleStore; +import xyz.nucleoid.fantasy.util.VoidWorldProgressListener; /** * A configuration describing how a runtime world should be constructed. This includes properties such as the dimension @@ -32,6 +34,7 @@ public final class RuntimeWorldConfig { private boolean mirrorOverworldGameRules = false; private boolean mirrorOverworldDifficulty = false; private RuntimeWorld.Constructor worldConstructor = RuntimeWorld::new; + private WorldGenerationProgressListener worldGenerationProgressListener = VoidWorldProgressListener.INSTANCE; private int sunnyTime = Integer.MAX_VALUE; private boolean raining; @@ -402,4 +405,12 @@ public boolean isThundering() { public TriState isFlat() { return this.flat; } + + public WorldGenerationProgressListener getWorldGenerationProgressListener() { + return this.worldGenerationProgressListener; + } + + public void setWorldGenerationProgressListener(WorldGenerationProgressListener listener) { + this.worldGenerationProgressListener = listener; + } }