immortius / chunkbychunk

Minecraft mod in which you unlock the world chunk by chunk
Other
17 stars 5 forks source link

[Function request] Convert existing world to Chunk by Chunk type #104

Closed OcrSu closed 1 month ago

OcrSu commented 6 months ago

I have been playing the Chunk by Chunk mod for a long time. The mod is very fun.

I have a idea of adding a tool that can convert a generated world into a chunk by chunk type.

This allows players to explore in the pre-set map through the Chunk by Chunk mod settings.

Moreover, after exploring all the pre-set map chunks , players can still continue to explore ungenerated chunks through Chunk by Chunk mod.

immortius commented 5 months ago

This can be done currently with some messing around with save data - you can copy the overworld dimension data from a source world into the generation dimension of a new chunk-by-chunk world with the same seed.

OcrSu commented 5 months ago

This can be done currently with some messing around with save data - you can copy the overworld dimension data from a source world into the generation dimension of a new chunk-by-chunk world with the same seed.

So, if the seeds are the same, the "chunk by chunk" mod will load the existing generated chunk data as the new chunk generation instead of regenerating the chunk data.

immortius commented 5 months ago

The seed doesn't have to match for the copied data to work, it just ensures that newly generated chunks fit seamlessly.

To go into some details of what is happening under the hood, Chunk By Chunk takes the standard overworld generation and applies it to a new dimension (chunkbychunk:skychunkgeneration). It then replaces the overworld generator with one that creates either an empty or sealed world. Then as chunks are spawned, it copies them across from the generator dimension to the overworld dimension.

So to set up a chunk by chunk save to generate a specific, existing world:

  1. Create the chunk by chunk world with the same seed (ideally).
  2. Replace the contents of the dimensions/chunkbychunk/skychunkgeneration subfolder of a chunk by chunk save with the, data, entities, poi and region from the desired save.
  3. Finally delete the data, entities, poi and region folders from chunk by chunk save so it will regenerate the overworld.

You will probably want to to disable the Initial Spawn Restriction so it will determine the starting location with Minecraft's normal logic - another reason to use the same seed.

OcrSu commented 5 months ago

The seed doesn't have to match for the copied data to work, it just ensures that newly generated chunks fit seamlessly.

To go into some details of what is happening under the hood, Chunk By Chunk takes the standard overworld generation and applies it to a new dimension (chunkbychunk:skychunkgeneration). It then replaces the overworld generator with one that creates either an empty or sealed world. Then as chunks are spawned, it copies them across from the generator dimension to the overworld dimension.

So to set up a chunk by chunk save to generate a specific, existing world:

  1. Create the chunk by chunk world with the same seed (ideally).
  2. Replace the contents of the dimensions/chunkbychunk/skychunkgeneration subfolder of a chunk by chunk save with the, data, entities, poi and region from the desired save.
  3. Finally delete the data, entities, poi and region folders from chunk by chunk save so it will regenerate the overworld.

You will probably want to to disable the Initial Spawn Restriction so it will determine the starting location with Minecraft's normal logic - another reason to use the same seed.

Thanks for the answer, I will try it.