mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-20 07:34:48 +01:00
#468: Allow delegation of certain elements to Vanilla when using a custom ChunkGenerator
Allows delegation of caves, decorations, mobs and structures to the Vanilla generation algorithms. Overriding these methods to return true enables that aspect of Vanilla generation, which is applied after the ChunkGenerator's custom generation. By: konsolas <vincentyntang@gmail.com>
This commit is contained in:
parent
30948a8444
commit
26409057b9
1 changed files with 46 additions and 1 deletions
|
@ -24,8 +24,13 @@ import org.jetbrains.annotations.Nullable;
|
|||
* 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
|
||||
* {@link #isParallelCapable()} should be overridden accordingly to allow
|
||||
* multiple concurrent callers.
|
||||
*
|
||||
* Some aspects of world generation can be delegated to the Vanilla generator.
|
||||
* The methods {@link ChunkGenerator#shouldGenerateCaves()}, {@link ChunkGenerator#shouldGenerateDecorations()},
|
||||
* {@link ChunkGenerator#shouldGenerateMobs()} and {@link ChunkGenerator#shouldGenerateStructures()} can be
|
||||
* overridden to enable this.
|
||||
*/
|
||||
public abstract class ChunkGenerator {
|
||||
|
||||
|
@ -182,6 +187,46 @@ public abstract class ChunkGenerator {
|
|||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets if the server should generate Vanilla caves after this
|
||||
* ChunkGenerator.
|
||||
*
|
||||
* @return true if the server should generate Vanilla caves
|
||||
*/
|
||||
public boolean shouldGenerateCaves() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets if the server should generate Vanilla decorations after this
|
||||
* ChunkGenerator.
|
||||
*
|
||||
* @return true if the server should generate Vanilla decorations
|
||||
*/
|
||||
public boolean shouldGenerateDecorations() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets if the server should generate Vanilla mobs after this
|
||||
* ChunkGenerator.
|
||||
*
|
||||
* @return true if the server should generate Vanilla mobs
|
||||
*/
|
||||
public boolean shouldGenerateMobs() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets if the server should generate Vanilla structures after this
|
||||
* ChunkGenerator.
|
||||
*
|
||||
* @return true if the server should generate Vanilla structures
|
||||
*/
|
||||
public boolean shouldGenerateStructures() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Data for a Chunk.
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue