diff --git a/src/main/java/org/spongepowered/api/world/extent/ExtentBufferFactory.java b/src/main/java/org/spongepowered/api/world/extent/ExtentBufferFactory.java index 4532364e11a..9f1a78be602 100644 --- a/src/main/java/org/spongepowered/api/world/extent/ExtentBufferFactory.java +++ b/src/main/java/org/spongepowered/api/world/extent/ExtentBufferFactory.java @@ -34,10 +34,21 @@ public interface ExtentBufferFactory { /** * Returns a new biome buffer of the desired size. * - * @param size The size of the buffer on x and z (y in the vector) + * @param size The size of the buffer on x, y, and z. * @return A new biome buffer */ - MutableBiomeVolume createBiomeBuffer(Vector3i size); + default MutableBiomeVolume createBiomeBuffer(Vector3i size) { + return createBiomeBuffer(Vector3i.ZERO, size); + } + + /** + * Returns a new biome buffer of the desired size and minimum position. + * + * @param min The minimum point of the buffer. + * @param size The size of the buffer on x, y, and z. + * @return A new biome buffer + */ + MutableBiomeVolume createBiomeBuffer(Vector3i min, Vector3i size); /** * Returns a new biome buffer of the desired size. @@ -51,14 +62,41 @@ default MutableBiomeVolume createBiomeBuffer(int xSize, int ySize, int zSize) { return createBiomeBuffer(new Vector3i(xSize, ySize, zSize)); } + /** + * Returns a new biome buffer of the desired size and minimum position. + * + * @param xMin The minimum point of the buffer on x + * @param yMin The minimum point of the buffer on y + * @param zMin The minimum point of the buffer on z + * @param xSize The size of the buffer on x + * @param ySize The size of the buffer on y + * @param zSize The size of the buffer on z + * @return A new biome buffer + */ + default MutableBiomeVolume createBiomeBuffer(int xMin, int yMin, int zMin, int xSize, int ySize, int zSize) { + return createBiomeBuffer(new Vector3i(xMin, yMin, zMin), new Vector3i(xSize, ySize, zSize)); + } + /** * Returns a new biome buffer of the desired size. This buffer is thread * safe. * - * @param size The size of the buffer on x and z (y in the vector) + * @param size The size of the buffer on x, y, and z. * @return A new biome buffer */ - MutableBiomeVolume createThreadSafeBiomeBuffer(Vector3i size); + default MutableBiomeVolume createThreadSafeBiomeBuffer(Vector3i size) { + return createThreadSafeBiomeBuffer(Vector3i.ZERO, size); + } + + /** + * Returns a new biome buffer of the desired size an minimum position. This + * buffer is thread safe. + * + * @param min The minimum point of the buffer. + * @param size The size of the buffer on x, y, and z. + * @return A new biome buffer + */ + MutableBiomeVolume createThreadSafeBiomeBuffer(Vector3i min, Vector3i size); /** * Returns a new biome buffer of the desired size. This buffer is thread @@ -73,13 +111,40 @@ default MutableBiomeVolume createThreadSafeBiomeBuffer(int xSize, int ySize, int return createThreadSafeBiomeBuffer(new Vector3i(xSize, ySize, zSize)); } + /** + * Returns a new biome buffer of the desired size. This buffer is thread + * safe. + * + * @param xMin The minimum point of the buffer on x + * @param yMin The minimum point of the buffer on y + * @param zMin The minimum point of the buffer on z + * @param xSize The size of the buffer on x + * @param ySize The size of the buffer on y + * @param zSize The size of the buffer on z + * @return A new biome buffer + */ + default MutableBiomeVolume createThreadSafeBiomeBuffer(int xMin, int yMin, int zMin, int xSize, int ySize, int zSize) { + return createThreadSafeBiomeBuffer(new Vector3i(xMin, yMin, zMin), new Vector3i(xSize, ySize, zSize)); + } + /** * Returns a new block buffer of the desired size. * - * @param size The size of the buffer on x, y and z + * @param size The size of the buffer on x, y, and z + * @return A new block buffer + */ + default MutableBlockVolume createBlockBuffer(Vector3i size) { + return createBlockBuffer(Vector3i.ZERO, size); + } + + /** + * Returns a new block buffer of the desired size and minimum position. + * + * @param min The minimum point of the buffer. + * @param size The size of the buffer on x, y, and z * @return A new block buffer */ - MutableBlockVolume createBlockBuffer(Vector3i size); + MutableBlockVolume createBlockBuffer(Vector3i min, Vector3i size); /** * Returns a new block buffer of the desired size. @@ -93,14 +158,41 @@ default MutableBlockVolume createBlockBuffer(int xSize, int ySize, int zSize) { return createBlockBuffer(new Vector3i(xSize, ySize, zSize)); } + /** + * Returns a new block buffer of the desired size and minimum position. + * + * @param xMin The minimum point of the buffer on x + * @param yMin The minimum point of the buffer on y + * @param zMin The minimum point of the buffer on z + * @param xSize The size of the buffer on x + * @param ySize The size of the buffer on y + * @param zSize The size of the buffer on z + * @return A new block buffer + */ + default MutableBlockVolume createBlockBuffer(int xMin, int yMin, int zMin, int xSize, int ySize, int zSize) { + return createBlockBuffer(new Vector3i(xMin, yMin, zMin), new Vector3i(xSize, ySize, zSize)); + } + /** * Returns a new block buffer of the desired size. This buffer is thread * safe. * - * @param size The size of the buffer on x, y and z + * @param size The size of the buffer on x, y, and z * @return A new block buffer */ - MutableBlockVolume createThreadSafeBlockBuffer(Vector3i size); + default MutableBlockVolume createThreadSafeBlockBuffer(Vector3i size) { + return createThreadSafeBlockBuffer(Vector3i.ZERO, size); + } + + /** + * Returns a new block buffer of the desired size and minimum position. This + * buffer is thread safe. + * + * @param min The minimum point of the buffer. + * @param size The size of the buffer on x, y, and z + * @return A new block buffer + */ + MutableBlockVolume createThreadSafeBlockBuffer(Vector3i min, Vector3i size); /** * Returns a new block buffer of the desired size. This buffer is thread @@ -115,6 +207,22 @@ default MutableBlockVolume createThreadSafeBlockBuffer(int xSize, int ySize, int return createThreadSafeBlockBuffer(new Vector3i(xSize, ySize, zSize)); } + /** + * Returns a new block buffer of the desired size and minimum position. This + * buffer is thread safe. + * + * @param xMin The minimum point of the buffer on x + * @param yMin The minimum point of the buffer on y + * @param zMin The minimum point of the buffer on z + * @param xSize The size of the buffer on x + * @param ySize The size of the buffer on y + * @param zSize The size of the buffer on z + * @return A new block buffer + */ + default MutableBlockVolume createThreadSafeBlockBuffer(int xMin, int yMin, int zMin, int xSize, int ySize, int zSize) { + return createThreadSafeBlockBuffer(new Vector3i(xMin, yMin, zMin), new Vector3i(xSize, ySize, zSize)); + } + /** * Returns a new archetype volume of the desired size. *