Reputation: 67
I'm currently working on a spigot server plugin and I want to modify the default world generator so that every chunk is made out of one random block. I heard that you can make a custom world generator but I only want to modify the default one. Is there any way to do that? Thanks in advance!
Upvotes: 2
Views: 1847
Reputation: 4908
You should use WorldCreator
like that:
new WorldCreator("myWorld").environment(Environment.NORMAL).generator(new MyGenerator()).createWorld();
Then, create the class MyGenerator
which should extend ChunkGenerator
like that:
public class MyGenerator extends ChunkGenerator {
// here define all methods from "ChunkGenerator" class like:
@Override
public boolean shouldGenerateCaves() {
return false;
}
}
You can change some configuration in the world creator, specially the name or the seed. Else, you should config other things in the MyGenerator's class.
Upvotes: 3