Posted November 22, 201410 yr 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?
November 22, 201410 yr 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!
November 22, 201410 yr 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 ###### } } } }
November 22, 201410 yr 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.