Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

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?

What obfuscated code? You'll need to use an IWorldGenerator (like for ores, but with WorldGenFlowers instead).

Check out my mod, Realms of Chaos, here.

 

If I helped you, be sure to press the "Thank You" button!

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 ######

}

}

}

}

  • Author

What obfuscated code? You'll need to use an IWorldGenerator (like for ores, but with WorldGenFlowers instead).

 

Ugh that was so obvious >.> Thanks Eternaldoom ;)

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...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.