wmcritter Posted July 9, 2015 Posted July 9, 2015 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. Quote
HenryRichard Posted July 9, 2015 Posted July 9, 2015 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). Quote 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.
wmcritter Posted July 9, 2015 Author Posted July 9, 2015 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? Quote
wmcritter Posted July 9, 2015 Author Posted July 9, 2015 Nevermind about the index error. It was PEBCAK error. Quote
Recommended Posts
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.