[Solved] Problem with BlockPopulators..

Discussion in 'Spigot Plugin Development' started by ChaoZ, Jun 13, 2015.

  1. Hello,
    A few days ago I started to work on a custom world generator, which works pretty good. But I've got one problem: I'm adding a BlockPopulator to the Generator, which should set the biome of every block to desert - but unfortunately it doesn't work all the time and I have no idea why :(.

    If you look at the biomes of the world, most parts are deserts - but some aren't..

    Code (Text):
    public class DesertPopulator extends BlockPopulator

        public DesertPopulator()

        public void populate(World world, Random random, Chunk chunk)
            int cx = chunk.getX();
            int cz = chunk.getZ();

            int rx = cx * 16;
            int rz = cz * 16;

            for (int x = 0; x < 16; x++)
                for (int z = 0; z < 16; z++)
                    world.setBiome(rx + z, rz + x, Biome.DESERT);
                    System.out.println("changing biome...");
    The "changing biome..." message appears in the console.

    Maybe you can help me :)
  2. Does your plugin load before the Worlds load?
  3. I'm creating a custom world while enabling my plugin, this shouldn't be the problem.
    But I'll see if it makes a difference ;)
  4. In setBiome(rx + z, rz + x, Biome) use the cx and cz instead rx and rz
  5. I was just trying to point out anything, I've never made custom generation, so I just threw out a common problem lol
  6. @Justin393 I appreciate that you tried to help me :)
  7. @Gsoares1928 cx and cz are chunk coordinates, unfortunately you have to set the biome of every block. But thanks for the effort ;)
  8. It looks like it was a problem with the client - it works after the chunks are refreshed.