diff --git a/paper-api/src/main/java/org/bukkit/generator/ChunkGenerator.java b/paper-api/src/main/java/org/bukkit/generator/ChunkGenerator.java index 6cb2bf60fb..0cc6e29a5a 100644 --- a/paper-api/src/main/java/org/bukkit/generator/ChunkGenerator.java +++ b/paper-api/src/main/java/org/bukkit/generator/ChunkGenerator.java @@ -42,12 +42,12 @@ import org.jetbrains.annotations.Nullable; * Some aspects of world generation can be delegated to the Vanilla generator. * The following methods can be overridden to enable this: * */ public abstract class ChunkGenerator { @@ -373,24 +373,73 @@ public abstract class ChunkGenerator { *

* The Vanilla noise is generated before * {@link #generateNoise(WorldInfo, Random, int, int, ChunkData)} is called. + *

+ * This is method is not called (and has therefore no effect), if + * {@link #shouldGenerateNoise(WorldInfo, Random, int, int)} is overridden. * * @return true if the server should generate Vanilla noise + * @see #shouldGenerateNoise(WorldInfo, Random, int, int) */ public boolean shouldGenerateNoise() { return false; } + /** + * Gets if the server should generate Vanilla noise. + *

+ * The Vanilla noise is generated before + * {@link #generateNoise(WorldInfo, Random, int, int, ChunkData)} is called. + *

+ * Only this method is called if both this and + * {@link #shouldGenerateNoise()} are overridden. + * + * @param worldInfo The world info of the world this chunk will be used for + * @param random The random generator to use + * @param chunkX The X-coordinate of the chunk + * @param chunkZ The Z-coordinate of the chunk + * @return true if the server should generate Vanilla noise + * @see #shouldGenerateNoise() + */ + public boolean shouldGenerateNoise(@NotNull WorldInfo worldInfo, @NotNull Random random, int chunkX, int chunkZ) { + return shouldGenerateNoise(); + } + + /** + * Gets if the server should generate Vanilla surface. + *

+ * The Vanilla surface is generated before + * {@link #generateSurface(WorldInfo, Random, int, int, ChunkData)} is + * called. + *

+ * This is method is not called (and has therefore no effect), if + * {@link #shouldGenerateSurface(WorldInfo, Random, int, int)} is overridden. + * + * @return true if the server should generate Vanilla surface + * @see #shouldGenerateSurface(WorldInfo, Random, int, int) + */ + public boolean shouldGenerateSurface() { + return false; + } + /** * Gets if the server should generate Vanilla surface. *

* The Vanilla surface is generated before * {@link #generateSurface(WorldInfo, Random, int, int, ChunkData)} is * called. + *

+ * Only this method is called if both this and + * {@link #shouldGenerateSurface()} are overridden. * + * @param worldInfo The world info of the world this chunk will be used for + * @param random The random generator to use + * @param chunkX The X-coordinate of the chunk + * @param chunkZ The Z-coordinate of the chunk * @return true if the server should generate Vanilla surface + * @see #shouldGenerateSurface() */ - public boolean shouldGenerateSurface() { - return false; + public boolean shouldGenerateSurface(@NotNull WorldInfo worldInfo, @NotNull Random random, int chunkX, int chunkZ) { + return shouldGenerateSurface(); } /** @@ -413,46 +462,139 @@ public abstract class ChunkGenerator { *

* The Vanilla caves are generated before * {@link #generateCaves(WorldInfo, Random, int, int, ChunkData)} is called. + *

+ * This is method is not called (and has therefore no effect), if + * {@link #shouldGenerateCaves(WorldInfo, Random, int, int)} is overridden. * * @return true if the server should generate Vanilla caves + * @see #shouldGenerateCaves(WorldInfo, Random, int, int) */ public boolean shouldGenerateCaves() { return false; } + /** + * Gets if the server should generate Vanilla caves. + *

+ * The Vanilla caves are generated before + * {@link #generateCaves(WorldInfo, Random, int, int, ChunkData)} is called. + *

+ * Only this method is called if both this and + * {@link #shouldGenerateCaves()} are overridden. + * + * @param worldInfo The world info of the world this chunk will be used for + * @param random The random generator to use + * @param chunkX The X-coordinate of the chunk + * @param chunkZ The Z-coordinate of the chunk + * @return true if the server should generate Vanilla caves + * @see #shouldGenerateCaves() + */ + public boolean shouldGenerateCaves(@NotNull WorldInfo worldInfo, @NotNull Random random, int chunkX, int chunkZ) { + return shouldGenerateCaves(); + } + + /** + * Gets if the server should generate Vanilla decorations after this + * ChunkGenerator. + *

+ * The Vanilla decoration are generated before any + * {@link BlockPopulator} are called. + *

+ * This is method is not called (and has therefore no effect), if + * {@link #shouldGenerateDecorations(WorldInfo, Random, int, int)} is overridden. + * + * @return true if the server should generate Vanilla decorations + * @see #shouldGenerateDecorations(WorldInfo, Random, int, int) + */ + public boolean shouldGenerateDecorations() { + return false; + } + /** * Gets if the server should generate Vanilla decorations after this * ChunkGenerator. *

* The Vanilla decoration are generated before any * {@link BlockPopulator} are called. + *

+ * Only this method is called if both this and + * {@link #shouldGenerateDecorations()} are overridden. * + * @param worldInfo The world info of the world this chunk will be used for + * @param random The random generator to use + * @param chunkX The X-coordinate of the chunk + * @param chunkZ The Z-coordinate of the chunk * @return true if the server should generate Vanilla decorations + * @see #shouldGenerateDecorations() */ - public boolean shouldGenerateDecorations() { - return false; + public boolean shouldGenerateDecorations(@NotNull WorldInfo worldInfo, @NotNull Random random, int chunkX, int chunkZ) { + return shouldGenerateDecorations(); } /** * Gets if the server should generate Vanilla mobs after this * ChunkGenerator. + *

+ * This is method is not called (and has therefore no effect), if + * {@link #shouldGenerateMobs(WorldInfo, Random, int, int)} is overridden. * * @return true if the server should generate Vanilla mobs + * @see #shouldGenerateMobs(WorldInfo, Random, int, int) */ public boolean shouldGenerateMobs() { return false; } + /** + * Gets if the server should generate Vanilla mobs after this + * ChunkGenerator. + *

+ * Only this method is called if both this and + * {@link #shouldGenerateMobs()} are overridden. + * + * @param worldInfo The world info of the world this chunk will be used for + * @param random The random generator to use + * @param chunkX The X-coordinate of the chunk + * @param chunkZ The Z-coordinate of the chunk + * @return true if the server should generate Vanilla mobs + * @see #shouldGenerateMobs() + */ + public boolean shouldGenerateMobs(@NotNull WorldInfo worldInfo, @NotNull Random random, int chunkX, int chunkZ) { + return shouldGenerateMobs(); + } + /** * Gets if the server should generate Vanilla structures after this * ChunkGenerator. + *

+ * This is method is not called (and has therefore no effect), if + * {@link #shouldGenerateStructures(WorldInfo, Random, int, int)} is overridden. * * @return true if the server should generate Vanilla structures + * @see #shouldGenerateStructures(WorldInfo, Random, int, int) */ public boolean shouldGenerateStructures() { return false; } + /** + * Gets if the server should generate Vanilla structures after this + * ChunkGenerator. + *

+ * Only this method is called if both this and + * {@link #shouldGenerateStructures()} are overridden. + * + * @param worldInfo The world info of the world this chunk will be used for + * @param random The random generator to use + * @param chunkX The X-coordinate of the chunk + * @param chunkZ The Z-coordinate of the chunk + * @return true if the server should generate Vanilla structures + * @see #shouldGenerateStructures() + */ + public boolean shouldGenerateStructures(@NotNull WorldInfo worldInfo, @NotNull Random random, int chunkX, int chunkZ) { + return shouldGenerateStructures(); + } + /** * Data for a Chunk. */