Jump to content

[1.8] Can you help me understand Y in chunks


wmcritter

Recommended Posts

I am trying my hand at generating my own terrain. I have had some success, but the Y coordinate is throwing me off.

I thought chunks were 16x16x16, and since the world is 256 high there are 16 chunks stacked on top of each other for each X and Z position. However, when the IChunkProvider is called, only X and Z values are passed, never a Y. And looking in ChunkProviderEnd I see that they are iterating through a for loop that I think is their Y values, but it is hard-coded to 127. So, are chunks actually 16x16x256? Or am I missing something entirely?

 

Thanks for any help you can offer.

Link to comment
Share on other sites

Chunks are 16x256x16 (xyz). They are saved to disk in 16x16x16 sections so that empty areas don't take up space, but they're generated 16x256x16 (still xyz).

I'll put something here when I have something of value I need to put at the end of every post. For now it's this mostly pointless text.

Link to comment
Share on other sites

Thanks for the quick reply.

As a quick test, I hard coded a 'for' loop as for(int y = 0; y < 256; y++) But it throws an index out of range error when I try to set that to the primer (primer.setBlockState(x, y, z, Blocks.stone.getDefaultState()).

I also tried 128. Happen to know why it would throw that error?

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.