ChunkGenerator, how to make bigger than 16x16 chunks

Discussion in 'Plugin Development' started by deadbeat91, Jan 27, 2012.

Thread Status:
Not open for further replies.
  1. here is the code I have right now but I would like it be 64 x 64 chunks

    Code:
    public byte[] generate(World world, Random random, int cx, int cz) {
            byte[] result = new byte[32768];
     
            for (int x = 0; x < 16; x++) {
                for (int z = 0; z < 16; z++) {
                    for (int y = 0; y < 1; y++) {
                        result[(x * 16 + z) * 128 + y] = (byte) Material.BEDROCK.getId();
                    }
                }
            }
       
            for (int x = 0; x < 16; x++) {
                for (int z = 0; z < 16; z++) {
                    for (int y = 1; y < 62; y++) {
                        result[(x * 16 + z) * 128 + y] = (byte) Material.DIRT.getId();
                    }
                }
            }
         
            for (int x = 0; x < 16; x++) {
                for (int z = 0; z < 16; z++) {
                    for (int y = 62; y < 63; y++) {
                        result[(x * 16 + z) * 128 + y] = (byte) Material.STONE.getId();
                    }
                }
            }
       
            for (int x = 2; x < 16; x++) {
                for (int z = 2; z < 16; z++) {
                    for (int y = 62; y < 63; y++) {
                        result[(x * 16 + z) * 128 + y] = (byte) Material.GRASS.getId();
                    }
                }
            }
     
            return result;
        }
    The example above will currently make a flat world with 1 bedrock at the bottom then dirt till 62 height then at 63 it will make a 15x15 grass patch with a stone boarder around it.
     
  2. Offline

    Aetherspawn

    Change x < 16 to x < 64?

    Edit: FYI I have no idea what Im talking about.
     
  3. Offline

    Steeveeo

    I'm not sure you CAN change the chunk size, since that's something hard-coded into Minecraft.
     
  4. Dam them haha thanks for the info though, must find a way around it :D
     
  5. Offline

    Steeveeo

    Why exactly were you wanting to increase the size, anyway?
     
  6. ^ This. You had to mod the server and the client to support lager chunks.
     
  7. Offline

    Sir Savary

    I assume you want to make the stone borders bigger? If so, it's not that hard. You just need to factor in the chunk positions, chunks 0,0 0,1 1,0 and 1,1 would be a square for example.
     
Thread Status:
Not open for further replies.

Share This Page