#749: Various javadoc improvements

By: DerFrZocker <derrieple@gmail.com>
This commit is contained in:
Bukkit/Spigot
2022-06-05 10:05:54 +10:00
parent eafbc2ba3a
commit 5e9386f3e0
11 changed files with 59 additions and 26 deletions

View File

@@ -3,6 +3,7 @@ package org.bukkit.generator;
import java.util.Random;
import org.bukkit.Chunk;
import org.bukkit.World;
import org.bukkit.event.world.WorldInitEvent;
import org.jetbrains.annotations.NotNull;
/**
@@ -10,6 +11,13 @@ import org.jetbrains.annotations.NotNull;
* <p>
* For example, generating glowstone inside the nether or generating dungeons
* full of treasure
* <p>
* A BlockPopulator can be used in combination with a custom {@link ChunkGenerator}
* by returning it in the method {@link ChunkGenerator#getDefaultPopulators(World)}
* or by adding it manually to the worlds populator list returned by {@link World#getPopulators()}.
* <p>
* When adding a BlockPopulator manually to a world it is recommended to do so during
* the {@link WorldInitEvent}.
*/
public abstract class BlockPopulator {
@@ -54,10 +62,10 @@ public abstract class BlockPopulator {
*
* @param worldInfo The world info of the world to generate in
* @param random The random generator to use
* @param x The X-coordinate of the chunk
* @param z The Z-coordinate of the chunk
* @param chunkX The X-coordinate of the chunk
* @param chunkZ The Z-coordinate of the chunk
* @param limitedRegion The chunk region to populate
*/
public void populate(@NotNull WorldInfo worldInfo, @NotNull Random random, int x, int z, @NotNull LimitedRegion limitedRegion) {
public void populate(@NotNull WorldInfo worldInfo, @NotNull Random random, int chunkX, int chunkZ, @NotNull LimitedRegion limitedRegion) {
}
}

View File

@@ -73,11 +73,11 @@ public abstract class ChunkGenerator {
*
* @param worldInfo The world info of the world this chunk will be used for
* @param random The random generator to use
* @param x The X-coordinate of the chunk
* @param z The Z-coordinate of the chunk
* @param chunkX The X-coordinate of the chunk
* @param chunkZ The Z-coordinate of the chunk
* @param chunkData To modify
*/
public void generateNoise(@NotNull WorldInfo worldInfo, @NotNull Random random, int x, int z, @NotNull ChunkData chunkData) {
public void generateNoise(@NotNull WorldInfo worldInfo, @NotNull Random random, int chunkX, int chunkZ, @NotNull ChunkData chunkData) {
}
/**
@@ -100,11 +100,11 @@ public abstract class ChunkGenerator {
*
* @param worldInfo The world info of the world this chunk will be used for
* @param random The random generator to use
* @param x The X-coordinate of the chunk
* @param z The Z-coordinate of the chunk
* @param chunkX The X-coordinate of the chunk
* @param chunkZ The Z-coordinate of the chunk
* @param chunkData To modify
*/
public void generateSurface(@NotNull WorldInfo worldInfo, @NotNull Random random, int x, int z, @NotNull ChunkData chunkData) {
public void generateSurface(@NotNull WorldInfo worldInfo, @NotNull Random random, int chunkX, int chunkZ, @NotNull ChunkData chunkData) {
}
/**
@@ -127,11 +127,11 @@ public abstract class ChunkGenerator {
*
* @param worldInfo The world info of the world this chunk will be used for
* @param random The random generator to use
* @param x The X-coordinate of the chunk
* @param z The Z-coordinate of the chunk
* @param chunkX The X-coordinate of the chunk
* @param chunkZ The Z-coordinate of the chunk
* @param chunkData To modify
*/
public void generateBedrock(@NotNull WorldInfo worldInfo, @NotNull Random random, int x, int z, @NotNull ChunkData chunkData) {
public void generateBedrock(@NotNull WorldInfo worldInfo, @NotNull Random random, int chunkX, int chunkZ, @NotNull ChunkData chunkData) {
}
/**
@@ -154,11 +154,11 @@ public abstract class ChunkGenerator {
*
* @param worldInfo The world info of the world this chunk will be used for
* @param random The random generator to use
* @param x The X-coordinate of the chunk
* @param z The Z-coordinate of the chunk
* @param chunkX The X-coordinate of the chunk
* @param chunkZ The Z-coordinate of the chunk
* @param chunkData To modify
*/
public void generateCaves(@NotNull WorldInfo worldInfo, @NotNull Random random, int x, int z, @NotNull ChunkData chunkData) {
public void generateCaves(@NotNull WorldInfo worldInfo, @NotNull Random random, int chunkX, int chunkZ, @NotNull ChunkData chunkData) {
}
/**
@@ -289,12 +289,12 @@ public abstract class ChunkGenerator {
* generator
* @return ChunkData containing the types for each block created by this
* generator
* @deprecated The generation is now split up
* @deprecated The generation is now split up and the new methods should be used, see {@link ChunkGenerator}
*/
@NotNull
@Deprecated
public ChunkData generateChunkData(@NotNull World world, @NotNull Random random, int x, int z, @NotNull BiomeGrid biome) {
throw new UnsupportedOperationException("Custom generator " + getClass().getName() + " is missing required method generateChunkData");
throw new UnsupportedOperationException("Not implemented, no longer needed");
}
/**