diff --git a/src/main/java/xyz/nucleoid/fantasy/RuntimeWorldManager.java b/src/main/java/xyz/nucleoid/fantasy/RuntimeWorldManager.java index ed4ba23..2fc45f8 100644 --- a/src/main/java/xyz/nucleoid/fantasy/RuntimeWorldManager.java +++ b/src/main/java/xyz/nucleoid/fantasy/RuntimeWorldManager.java @@ -7,6 +7,7 @@ import net.minecraft.registry.SimpleRegistry; import net.minecraft.registry.entry.RegistryEntryInfo; import net.minecraft.server.MinecraftServer; +import net.minecraft.server.world.ChunkTicketManager; import net.minecraft.server.world.ServerWorld; import net.minecraft.text.Text; import net.minecraft.util.ProgressListener; @@ -47,6 +48,7 @@ RuntimeWorld add(RegistryKey worldKey, RuntimeWorldConfig config, Runtime ((RemoveFromRegistry) dimensionsRegistry).fantasy$setFrozen(isFrozen); RuntimeWorld world = config.getWorldConstructor().createWorld(this.server, worldKey, config, style); + this.promoteForcedChunksToTickets(world); this.serverAccess.getWorlds().put(world.getRegistryKey(), world); ServerWorldEvents.LOAD.invoker().onWorldLoad(this.server, world); @@ -57,6 +59,13 @@ RuntimeWorld add(RegistryKey worldKey, RuntimeWorldConfig config, Runtime return world; } + private void promoteForcedChunksToTickets(ServerWorld world) { + ChunkTicketManager chunkTicketManager = world.getPersistentStateManager().get(ChunkTicketManager.STATE_TYPE); + if (chunkTicketManager != null) { + chunkTicketManager.promoteToRealTickets(); + } + } + void delete(ServerWorld world) { RegistryKey dimensionKey = world.getRegistryKey();