Don't concurrently execute ChunkGenerators by default

By: md_5 <git@md-5.net>
This commit is contained in:
Bukkit/Spigot 2019-04-26 12:08:49 +10:00
parent 5908b5a155
commit f52951980e

View File

@ -17,7 +17,15 @@ import org.jetbrains.annotations.Nullable;
/**
* A chunk generator is responsible for the initial shaping of an entire
* chunk. For example, the nether chunk generator should shape netherrack and
* soulsand
* soulsand.
*
* By default only one thread will call
* {@link #generateChunkData(org.bukkit.World, java.util.Random, int, int, org.bukkit.generator.ChunkGenerator.BiomeGrid)}
* at a time, although this may not necessarily be the main server thread.
*
* If your generator is capable of fully asynchronous generation, then
* {@link #isParallelCapable()} should be overriden accordingly to allow
* multiple concurrent callers.
*/
public abstract class ChunkGenerator {
@ -138,6 +146,17 @@ public abstract class ChunkGenerator {
return null;
}
/**
* Gets if this ChunkGenerator is parallel capable.
*
* See {@link ChunkGenerator} for more information.
*
* @return parallel capable status
*/
public boolean isParallelCapable() {
return false;
}
/**
* Data for a Chunk.
*/