Interface GenerationRegion

    • Method Detail

      • worldKey

        ResourceKey worldKey()
        The ResourceKey of the ServerWorld that this region will be placed into.

        As generation regions are designed to be thread-safe with regards to world generation, it is entirely possible that you may retrieve a region off the main server thread. As ServerWorld instances are not thread safe, you should ensure that Engine.onMainThread() is true before retreving the world.

        Returns:
        The ResourceKey that represents the target ServerWorld
      • chunkMin

        Vector3i chunkMin()
        The minimum chunk co-ordinate of this region.
        Returns:
        The chunk co-ordinate as a Vector3i
      • chunkMax

        Vector3i chunkMax()
        The maximum chunk co-ordinate of this region.
        Returns:
        The chunk co-ordinate as a Vector3i
      • chunkAtBlock

        default GenerationChunk chunkAtBlock​(int x,
                                             int y,
                                             int z)
        Gets the GenerationChunk at the given block co-ordinates
        Specified by:
        chunkAtBlock in interface ChunkVolume
        Parameters:
        x - The x co-ordinate
        y - The y co-ordinate
        z - The z co-ordinate
        Returns:
        The GenerationChunk
        Throws:
        java.lang.IllegalArgumentException - if the provided co-ordinates are out of bounds.
      • chunk

        GenerationChunk chunk​(int cx,
                              int cy,
                              int cz)
        Gets the GenerationChunk at the given chunk co-ordinates
        Specified by:
        chunk in interface ChunkVolume
        Parameters:
        cx - The x co-ordinate
        cy - The y co-ordinate
        cz - The z co-ordinate
        Returns:
        The GenerationChunk
        Throws:
        java.lang.IllegalArgumentException - if the provided co-ordinates are out of bounds.