Discord Support #40
-
Possibly add Discord Support for us to join and ask for support! <3 |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
But if you can't, my 2 questions are:
int actualX = x * 4;
int actualY = y * 4;
int actualZ = z * 4;
Location loc = new Location(world, actualX, actualY, actualZ);
Utils.broadcast(loc.toString());
Chunk chunk = world.getChunkAt(loc);
|
Beta Was this translation helpful? Give feedback.
-
I don't know if the community is large enough for a Discord. For your first question: I'm not sure what you are coding. Are you implementing a custom biome generator? Then you cannot access chunks, as those don't exist yet when generating terrain. For the second question: if the chunk already exists, just use the Bukkit API to change biomes, see https://bukkit.org/threads/change-biome.73734/ . You don't need WorldGeneratorAPI for that. If you want to set the biome for new chunks, create your own biome generator. Have a look at this page: https://github.com/rutgerkok/WorldGeneratorApi/wiki/Biome-generators . It contains examples on how to modify the vanilla biome generator, as well as to how you could create a custom one. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Ok, I've set up a small discussion forum. But please don't expect me to provide too much support, I've got many other things to do. I've made the code public in the hope that it will be useful to others, not to assist everyone in building their own terrain generator. (That was the goal back when I was maintaining TerrainControl, but that costed waaaaay too much time.) If you assign biomes using a BiomeGenerator, then the vanilla terrain generator should automatically generate the correct terrain for that biome. If you use WorldEdit and //regen, then the terrain should still correctly generate. From #38 , it looks like you're already using a BiomeGenerator, so I'm not sure what is going on here. Something like this should work as a random biome generator. (It still consistently returns the same biome for a given (x,y,z), which is required, otherwise the biome can change mid-generation.) private static class YourBiomeGenerator implements BiomeGenerator {
private final ImmutableList<Biome> allBiomes = ImmutableList
.copyOf(BiomeGenerator.VANILLA_OVERWORLD_STRUCTURE_BIOMES);
private final ImmutableSet<Biome> allBiomesAsSet = ImmutableSet.copyOf(allBiomes);
private final YourConfigClass config;
private YourBiomeGenerator (YourConfigClass config) {
this.config = config;
}
@Override
public ImmutableSet<Biome> getStructureBiomes() {
return allBiomesAsSet;
}
@Override
public Biome getZoomedOutBiome(int x, int y, int z) {
long seed = config.biomeGeneratorSeed;
Random random = new Random(seed ^ x ^ z);
return allBiomes.get(random.nextInt(allBiomes.size()));
}
} |
Beta Was this translation helpful? Give feedback.
Ok, I've set up a small discussion forum. But please don't expect me to provide too much support, I've got many other things to do. I've made the code public in the hope that it will be useful to others, not to assist everyone in building their own terrain generator. (That was the goal back when I was maintaining TerrainControl, but that costed waaaaay too much time.)
If you assign biomes using a BiomeGenerator, then the vanilla terrain generator should automatically generate the correct terrain for that biome. If you use WorldEdit and //regen, then the terrain should still correctly generate.
From #38 , it looks like you're already using a BiomeGenerator, so I'm not sure what is going on…