Jump to content

Recommended Posts

Posted

Hello, I am having issues with generating my custom flowers in vanilla biomes. I have tried playing around with WorldGenFlowers but I can't make any sense of it due to the obfuscated code. I may be missing something obvious there. Can someone point me in the right direction?

Posted

register it all appropriately in your main class and make the block you want to generate (flower) then create a code similar to mine below to spawn it in  its no different to spawning an ore

 

 

public class WorldGenPlants implements IWorldGenerator

{

@Override

public void generate(Random random, int chunkX, int chunkZ, World world,

IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {

 

                ####-1 is nether and 1 is the end 0 obviously surface###########

switch(world.provider.dimensionId){

case 0 : generateSurface(world, random, chunkX*16, chunkZ*16);

 

}

}

 

private void generateSurface(World world, Random random, int x, int z)

{

 

                        ######### replace X with a number the higher the more common the lower the number the rarer ##########

for(int k = 0; k < X; k++)

{

                                ######3 if you want it to spawn in a specific biome then use the code below in "****" if not remove it

    ******BiomeGenBase Biome = world.getBiomeGenForCoords(x, z);

if(Biome != BiomeGenBase.desert && Biome != BiomeGenBase.desertHills && Biome != BiomeGenBase.icePlains && Biome != BiomeGenBase.iceMountains)*****{

int j1 = x + random.nextInt(16);

int i2 = random.nextInt(128); ####below this height will they spawn

int l2 = z + random.nextInt(16);

(new WorldGenFlowers(ModBlocks.YourFlower)).generate(world, random, j1, i2, l2); ######## input your flower ######

}

}

}

}

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.