Posted May 25, 201411 yr So I have a structure that I am generating, but it is too common. Changing the "chunkX * 16, chunkZ * 16" to "chunkX * 128, chunkZ * 128" makes it rarer but also generates super super slowly. @Override public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) { switch (world.provider.dimensionId) { case -1: generateNether(world, random, chunkX * 16, chunkZ * 16); case 0: generateSurface(world, random, chunkX * 16, chunkZ * 16); case 1: generateEnd(world, random, chunkX * 16, chunkZ * 16); } } private void generateEnd(World world, Random random, int x, int z) { } private void generateSurface(World world, Random random, int x, int z) { } private void generateNether(World world, Random random, int x, int z) { //Nethengeic Pit Coords// int Xcoord = x + random.nextInt(16); int Ycoord = 25 + random.nextInt(35); int Zcoord = z + random.nextInt(16); (new NetherTower()).generate(world, random, Xcoord, Ycoord, Zcoord);
May 26, 201411 yr --------------------- Edited August 18, 20187 yr by chimera27 Creator of Metroid Cubed! Power Suits, Beams, Hypermode and more! http://i.imgur.com/ghgWmA3.jpg[/img]
May 26, 201411 yr Author Just use the random function to reduce the chance, IE: if(Random.nextInt(5) == 1){ //Generation code } This will effectively make it 1/5 as common. (Just change the 5 into whatever you want the denominator of the chance fraction to be) This is actually what I ended up doing yesterday. Thanks for the tip.
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.