Posted February 6, 201312 yr Hi, i'm doing a school project regarding terrain generation in minecraft and i'm having some problems. I already managed to generate structures ingame but i also need to override minecraft generation to generate the entire world and i can't figure out how. I know that i can create a new dimension to generate my world but i really would like to do it in the overworld if possible. How can i achieve that? Thank you.
February 6, 201312 yr You need to create a new world type or overwrite the default and in the new WorldType.class you create you can specify a custom ChunkProviderGenerate - look at the default version that is where the generation is done.
February 7, 201312 yr Author Thank you very much it worked. But now i have another question... I looked into the ChunkProvider and i noticed two methods to generate terrain : 1) The first one is to create an array of bytes and send it to this method public Chunk(World world, byte[] ids, byte[] metadata, int chunkX, int chunkZ) Wich doesn't seem too complicated 2) The second is (i think) to generate the terrain data after creating the chunk like this // Generate extended block storage for (int y=0; y<16; y++) { chunk.getBlockStorageArray()[y] = new ExtendedBlockStorage(y << 4, true); } // Generate 16x16 square of grass blocks at y value of 63. for (int x=0; x<16; x++) { for (int z=0; z<16; z++) { chunk.getBlockStorageArray()[3].setExtBlockID(x, 15/*y*/, z, Block.grass.blockID); } } i don't really understand how it works but it does Which one is the best to use? Thanks again.
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.