diff --git a/paper-api/src/main/java/org/bukkit/generator/BiomeParameterPoint.java b/paper-api/src/main/java/org/bukkit/generator/BiomeParameterPoint.java new file mode 100644 index 0000000000..ad02447d75 --- /dev/null +++ b/paper-api/src/main/java/org/bukkit/generator/BiomeParameterPoint.java @@ -0,0 +1,140 @@ +package org.bukkit.generator; + +/** + * Represents the biome noise parameters which may be passed to a world + * generator. + */ +public interface BiomeParameterPoint { + + /** + * Gets the temperature of the biome at this point that is suggested by the + * NoiseGenerator. + * + * @return The temperature of the biome at this point + */ + double getTemperature(); + + /** + * Gets the maximum temperature that is possible. + * + * @return The maximum temperature + */ + double getMaxTemperature(); + + /** + * Gets the minimum temperature that is possible. + * + * @return The minimum temperature + */ + double getMinTemperature(); + + /** + * Gets the humidity of the biome at this point that is suggested by the + * NoiseGenerator. + * + * @return The humidity of the biome at this point + */ + double getHumidity(); + + /** + * Gets the maximum humidity that is possible. + * + * @return The maximum humidity + */ + double getMaxHumidity(); + + /** + * Gets the minimum humidity that is possible. + * + * @return The minimum humidity + */ + double getMinHumidity(); + + /** + * Gets the continentalness of the biome at this point that is suggested by + * the NoiseGenerator. + * + * @return The continentalness of the biome at this point + */ + double getContinentalness(); + + /** + * Gets the maximum continentalness that is possible. + * + * @return The maximum continentalness + */ + double getMaxContinentalness(); + + /** + * Gets the minimum continentalness that is possible. + * + * @return The minimum continentalness + */ + double getMinContinentalness(); + + /** + * Gets the erosion of the biome at this point that is suggested by the + * NoiseGenerator. + * + * @return The erosion of the biome at this point + */ + double getErosion(); + + /** + * Gets the maximum erosion that is possible. + * + * @return The maximum erosion + */ + double getMaxErosion(); + + /** + * Gets the minimum erosion that is possible. + * + * @return The minimum erosion + */ + double getMinErosion(); + + /** + * Gets the depth of the biome at this point that is suggested by the + * NoiseGenerator. + * + * @return The depth of the biome at this point + */ + double getDepth(); + + /** + * Gets the maximum depth that is possible. + * + * @return The maximum depth + */ + double getMaxDepth(); + + /** + * Gets the minimum depth that is possible. + * + * @return The minimum depth + */ + double getMinDepth(); + + /** + * Gets the weirdness of the biome at this point that is suggested by the + * NoiseGenerator. + * + * @return The weirdness of the biome at this point + */ + double getWeirdness(); + + /** + * Gets the maximum weirdness that is possible. + * + * @return The maximum weirdness + */ + double getMaxWeirdness(); + + /** + * Gets the minimum weirdness that is possible. + * + * @return The minimum weirdness + */ + double getMinWeirdness(); +} diff --git a/paper-api/src/main/java/org/bukkit/generator/BiomeProvider.java b/paper-api/src/main/java/org/bukkit/generator/BiomeProvider.java index 9f6d75af20..65fd14b7b3 100644 --- a/paper-api/src/main/java/org/bukkit/generator/BiomeProvider.java +++ b/paper-api/src/main/java/org/bukkit/generator/BiomeProvider.java @@ -31,6 +31,36 @@ public abstract class BiomeProvider { @NotNull public abstract Biome getBiome(@NotNull WorldInfo worldInfo, int x, int y, int z); + /** + * Return the Biome which should be present at the provided location. + *
+ * Notes: + *
+ * This method must be completely thread safe and able to handle + * multiple concurrent callers. + *
+ * This method should only return biomes which are present in the list + * returned by {@link #getBiomes(WorldInfo)} + *
+ * This method should never return {@link Biome#CUSTOM}. + * Only this method is called if both this and + * {@link #getBiome(WorldInfo, int, int, int)} are overridden. + * + * @param worldInfo The world info of the world the biome will be used for + * @param x The X-coordinate from world origin + * @param y The Y-coordinate from world origin + * @param z The Z-coordinate from world origin + * @param biomeParameterPoint The parameter point that is provided by default + * for this location (contains temperature, humidity, + * continentalness, erosion, depth and weirdness) + * @return Biome for the given location + * @see #getBiome(WorldInfo, int, int, int) + */ + @NotNull + public Biome getBiome(@NotNull WorldInfo worldInfo, int x, int y, int z, @NotNull BiomeParameterPoint biomeParameterPoint) { + return getBiome(worldInfo, x, y, z); + } + /** * Returns a list with every biome the {@link BiomeProvider} will use for * the given world.