Posted February 3, 201312 yr Im having a little problem with my structure generation. it generates fine but i only want 1 structure to generate and there are more structres generating. most of the time 3 or 4 and sometimes even 5. here is the code that generates my structure public class WorldGenerator implements IWorldGenerator{ private boolean alreadyRendered = false; @Override public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) { System.out.println("generating called"); generateWatchtower(world, random, chunkX*16, chunkZ*16); } private void generateWatchtower(World world, Random random, int i, int j) { while(alreadyRendered == false){ int startX = world.getWorldInfo().getSpawnX(); int startZ = world.getWorldInfo().getSpawnZ(); int Xcoord1 = startX + random.nextInt(30) + 20; int Zcoord1 = startZ + random.nextInt(30) + 20; int blocks[] = new int[]{Block.grass.blockID, Block.sand.blockID, Block.stone.blockID}; int iii; for (int ii = 0; ii < 128; ii++){ if(world.canBlockSeeTheSky(Xcoord1, ii+1, Zcoord1) == true){ iii = world.getBlockId(Xcoord1, ii, Zcoord1); if(iii == blocks[0] || iii == blocks[1] || iii == blocks[2]){ new WorldGenWatchtower().generate(world, random, Xcoord1, ii+1, Zcoord1); alreadyRendered = true; } } } } } sometimes there arent structures generating at all. when i generate a superflat map most of the time the structures wont generate. im really hoping someone can help me with this because i really dont know a solution. http://www.minecraftforum.net/topic/1937703-162smpforge-pet-mastery-hatch-level-battle/
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.