Posted June 18, 20169 yr I am trying to generate flowers, but the problem is that I don't know how I should get the wright y-value. ModFlowerGenerator.java: http://pastebin.com/PQ2Rp6yx ModWorldGeneratorFlowers: http://pastebin.com/qexEeP6P http://i.imgur.com/J4rrGt6.png[/img] [Creator of mcrafterzz mod]
June 18, 20169 yr public boolean generate(World worldIn, Random rand, BlockPos position) { for (int i = 0; i < 20; ++i) { BlockPos blockpos = position.add(rand.nextInt( - rand.nextInt(, rand.nextInt(4) - rand.nextInt(4), rand.nextInt( - rand.nextInt(); if (blockpos.getX() > 0 && blockpos.getY() > 0 && blockpos.getZ() > 0 && blockpos.getY() < 255) { if (worldIn.isAirBlock(blockpos) && (!worldIn.provider.getHasNoSky()) && this.flower.canBlockStay(worldIn, blockpos, this.state)) { worldIn.setBlockState(blockpos, this.state, 2); } } } return true; } Where are you calling this method? Also, this.flower.canBlockStay(worldIn, blockpos, this.state), what is it actually looking for and in what direction?
June 18, 20169 yr Author In modflowergenerator http://i.imgur.com/J4rrGt6.png[/img] [Creator of mcrafterzz mod]
June 18, 20169 yr Author Any more replys? http://i.imgur.com/J4rrGt6.png[/img] [Creator of mcrafterzz mod]
June 19, 20169 yr Don't bump your thread so often. In the world generator, you can set the minimum height. You also can set, what block to replace, and you can check in the flower class, if it can stay on the block it was generated on. So now go and fix your bug!
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.