Hello! I need to repopulate some area (after hard players activities some regions of our server are turned to wastelands ). Is there a way to execute populator and get a new trees, grass, animals, villages (and may be strongholds) in defined area/chunk?
Mmmmm.... This forum is called "Plugin Development" and think no one will ask here about world edit commands WorldEdit use world.regenerateChunk(x,z) method. But this method is regenerating full chunk (deleting old chunk and create new one). But I don't need to regenerate full chunk. I just need to repopulate it: i need new trees, grass, villages... etc.
I think you can do it manually by first getting a list of all populators of a world with world.getPopulators(), then invoking populator.populate(World world, Random random, Chunk source) for each populator and on every chunk you want to repopulate.
Or you could make it completely random, resulting in a new landscape every time the same chunks are repopulated.
Hello... sometimes ago I found some time to test it. And I find that word.getPopulators() is empty everytime. So I cannot start populator from this list...
its empty when its generated by minecraft code, minecraft works else than bukkit if you want populators
Yes, world is generated without any additional generators. But I need to repopulate area? Is there a way to access a minecraft populators and force to repopulate chunks/area?
@fromgate trees and grass is quite easy: randomly use world.generateTree(Location l, TreeType type) for trees and get like x locations with air above the highest block and set that to grass. (Though, the grass might not look as good as you want)
@fireblast709, thank you! I know it But I want to use built-in populator. I find interesting topic about generating NPC villages: http://forums.bukkit.org/threads/what-do-i-call-to-generate-an-npc-village.90620/#post-1257984 May be there's same way to repopulate area...
I found some WorldGen classes for trees, but in the end the Bukkit world.generateTree() method uses that to generate them. I however found a few generators in NMS code you might like (I got this from decompiled, deobfuscated minecraft. The classes are usable if you use CB.jar) Code:java // WorldGen classes + initializationWorldGenBigMushroom gen = WorldGenBigMushroom(int mush_id);WorldGenBigTree gen = WorldGenBigTree(true);WorldGenCactus gen = WorldGenCactus();WorldGenDeadBush gen = WorldGenDeadBush(int deadbush_id);WorldGenFlowers gen = WorldGenFlowers(int flower_id);WorldGenForest gen = WorldGenForest(true);WorldGenHugeTrees gen = WorldGenHugeTrees(true, int baseHeight, int woodMetadata, int leavesMetadata);WorldGenPumpkin gen = WorldGenPumpkin();WorldGenReed gen = WorldGenReed();WorldGenShrub gen = WorldGenShrub();WorldGenTallGrass gen = WorldGenTallGrass(int id, int metadata);WorldGenTrees gen = WorldGenTrees(true, int minHeight, int metaWood, int metaLeaves, boolean vinesGrow);WorldGenVines gen = WorldGenVines();WorldGenWaterLily gen = WorldGenWaterLily();// Choose ONE of the above, then call// Random is a self defined random (might be usefull to make weighted randoms)gen.(net.minecraft.World world, Random random, int x, int y, int z); Note that it will not exactly spawn one thing at Location (x,y,z), but it will actually "generate" randomly