Jump to content

[Solved][1.15.2] Custom Feature runs on every Chunk load?


gottsch

Recommended Posts

HI. I've added a custom test Feature, which adds a block to the surface.  What i'm noticing is that the Feature generation is running every time a chunk loads. Isn't it only supposed to run once on chunk generation?

 

Thanks

Edited by gottsch
Link to comment
Share on other sites

Thanks ChampionAsh. That was my assumption on how it would work. Maybe it is the term "resolved" that could use more explaining. I did some more testing:

1. exploring my immediate area. 

2. save and exit.

3. load world

repeat steps 2 and 3.

 

There are a set of chunks a distance away from me that generate on every load. If I get closer to them and save, exit and reload, then they won't generate. Does minecraft pre-generate non-visible chunks and then resolve them when they come within the render distance (thus being re-generated if they never were in render distance)?

Link to comment
Share on other sites

1 hour ago, gottsch said:

Does minecraft pre-generate non-visible chunks and then resolve them when they come within the render distance (thus being re-generated if they never were in render distance)?

So, yes and no. Chunk generation is handled asynchronously to reduce the strain on the main thread and avoid any major lag spike. A chunk on generation is a ChunkPrimer where it uses the players location to determine whether to resolve. Once resolved, that Chunk will never change from world generation. However, these chunks can be partially resolved when being loaded. This allows certain features or structures to be determined without actually resolving the chunk itself. I'm guessing that's what you mean by pre-generating non-visible chunks.

 

The rendering and actual logic of chunks is handled separately. Logic will only happen within an 8 chunk square around the player while rendering can show any specified distance. Rendering iirc partially resolves the chunk and the logic on the server fully loads in once the player gets close enough. Since the game uses a seed which determines almost everything about world generation, it isn't hard to partially resolve a chunk on the client until it needs to be resolved on the server.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.