Interface ChunkGenerator.ChunkData

Enclosing class:
ChunkGenerator

public static interface ChunkGenerator.ChunkData
Data for a Chunk.
  • Method Summary

    Modifier and Type Method Description
    byte getData​(int x, int y, int z)
    Deprecated.
    Uses magic values
    int getMaxHeight()
    Get the maximum height for the chunk.
    Material getType​(int x, int y, int z)
    Get the type of the block at x, y, z.
    MaterialData getTypeAndData​(int x, int y, int z)
    Get the type and data of the block at x, y ,z.
    int getTypeId​(int x, int y, int z)
    Deprecated.
    Uses magic values
    void setBlock​(int x, int y, int z, int blockId)
    Deprecated.
    Uses magic values
    void setBlock​(int x, int y, int z, int blockId, byte data)
    Deprecated.
    Uses magic values
    void setBlock​(int x, int y, int z, Material material)
    Set the block at x,y,z in the chunk data to material.
    void setBlock​(int x, int y, int z, MaterialData material)
    Set the block at x,y,z in the chunk data to material.
    void setRegion​(int xMin, int yMin, int zMin, int xMax, int yMax, int zMax, int blockId)
    Deprecated.
    Uses magic values.
    void setRegion​(int xMin, int yMin, int zMin, int xMax, int yMax, int zMax, int blockId, int data)
    Deprecated.
    Uses magic values.
    void setRegion​(int xMin, int yMin, int zMin, int xMax, int yMax, int zMax, Material material)
    Set a region of this chunk from xMin, yMin, zMin (inclusive) to xMax, yMax, zMax (exclusive) to material.
    void setRegion​(int xMin, int yMin, int zMin, int xMax, int yMax, int zMax, MaterialData material)
    Set a region of this chunk from xMin, yMin, zMin (inclusive) to xMax, yMax, zMax (exclusive) to material.
  • Method Details

    • getMaxHeight

      int getMaxHeight()
      Get the maximum height for the chunk. Setting blocks at or above this height will do nothing.
      Returns:
      the maximum height
    • setBlock

      void setBlock​(int x, int y, int z, Material material)
      Set the block at x,y,z in the chunk data to material. Note: setting blocks outside the chunk's bounds does nothing.
      Parameters:
      x - the x location in the chunk from 0-15 inclusive
      y - the y location in the chunk from 0 (inclusive) - maxHeight (exclusive)
      z - the z location in the chunk from 0-15 inclusive
      material - the type to set the block to
    • setBlock

      void setBlock​(int x, int y, int z, MaterialData material)
      Set the block at x,y,z in the chunk data to material. Setting blocks outside the chunk's bounds does nothing.
      Parameters:
      x - the x location in the chunk from 0-15 inclusive
      y - the y location in the chunk from 0 (inclusive) - maxHeight (exclusive)
      z - the z location in the chunk from 0-15 inclusive
      material - the type to set the block to
    • setRegion

      void setRegion​(int xMin, int yMin, int zMin, int xMax, int yMax, int zMax, Material material)
      Set a region of this chunk from xMin, yMin, zMin (inclusive) to xMax, yMax, zMax (exclusive) to material. Setting blocks outside the chunk's bounds does nothing.
      Parameters:
      xMin - minimum x location (inclusive) in the chunk to set
      yMin - minimum y location (inclusive) in the chunk to set
      zMin - minimum z location (inclusive) in the chunk to set
      xMax - maximum x location (exclusive) in the chunk to set
      yMax - maximum y location (exclusive) in the chunk to set
      zMax - maximum z location (exclusive) in the chunk to set
      material - the type to set the blocks to
    • setRegion

      void setRegion​(int xMin, int yMin, int zMin, int xMax, int yMax, int zMax, MaterialData material)
      Set a region of this chunk from xMin, yMin, zMin (inclusive) to xMax, yMax, zMax (exclusive) to material. Setting blocks outside the chunk's bounds does nothing.
      Parameters:
      xMin - minimum x location (inclusive) in the chunk to set
      yMin - minimum y location (inclusive) in the chunk to set
      zMin - minimum z location (inclusive) in the chunk to set
      xMax - maximum x location (exclusive) in the chunk to set
      yMax - maximum y location (exclusive) in the chunk to set
      zMax - maximum z location (exclusive) in the chunk to set
      material - the type to set the blocks to
    • getType

      Material getType​(int x, int y, int z)
      Get the type of the block at x, y, z. Getting blocks outside the chunk's bounds returns air.
      Parameters:
      x - the x location in the chunk from 0-15 inclusive
      y - the y location in the chunk from 0 (inclusive) - maxHeight (exclusive)
      z - the z location in the chunk from 0-15 inclusive
      Returns:
      the type of the block or Material.AIR if x, y or z are outside the chunk's bounds
    • getTypeAndData

      MaterialData getTypeAndData​(int x, int y, int z)
      Get the type and data of the block at x, y ,z. Getting blocks outside the chunk's bounds returns air.
      Parameters:
      x - the x location in the chunk from 0-15 inclusive
      y - the y location in the chunk from 0 (inclusive) - maxHeight (exclusive)
      z - the z location in the chunk from 0-15 inclusive
      Returns:
      the type and data of the block or the MaterialData for air if x, y or z are outside the chunk's bounds
    • setRegion

      @Deprecated void setRegion​(int xMin, int yMin, int zMin, int xMax, int yMax, int zMax, int blockId)
      Deprecated.
      Uses magic values.
      Set a region of this chunk from xMin, yMin, zMin (inclusive) to xMax, yMax, zMax (exclusive) to block id. Setting blocks outside the chunk's bounds does nothing.
      Parameters:
      xMin - minimum x location (inclusive) in the chunk to set
      yMin - minimum y location (inclusive) in the chunk to set
      zMin - minimum z location (inclusive) in the chunk to set
      xMax - maximum x location (exclusive) in the chunk to set
      yMax - maximum y location (exclusive) in the chunk to set
      zMax - maximum z location (exclusive) in the chunk to set
      blockId - the block id to set the blocks to
    • setRegion

      @Deprecated void setRegion​(int xMin, int yMin, int zMin, int xMax, int yMax, int zMax, int blockId, int data)
      Deprecated.
      Uses magic values.
      Set a region of this chunk from xMin, yMin, zMin (inclusive) to xMax, yMax, zMax (exclusive) to block id and data. Setting blocks outside the chunk's bounds does nothing.
      Parameters:
      xMin - minimum x location (inclusive) in the chunk to set
      yMin - minimum y location (inclusive) in the chunk to set
      zMin - minimum z location (inclusive) in the chunk to set
      xMax - maximum x location (exclusive) in the chunk to set
      yMax - maximum y location (exclusive) in the chunk to set
      zMax - maximum z location (exclusive) in the chunk to set
      blockId - the block id to set the blocks to
      data - the block data to set the blocks to
    • setBlock

      @Deprecated void setBlock​(int x, int y, int z, int blockId)
      Deprecated.
      Uses magic values
      Set the block at x,y,z in the chunk data to blockId. Setting blocks outside the chunk's bounds does nothing.
      Parameters:
      x - the x location in the chunk from 0-15 inclusive
      y - the y location in the chunk from 0 (inclusive) - maxHeight (exclusive)
      z - the z location in the chunk from 0-15 inclusive
      blockId - the blockId to set the block to
    • setBlock

      @Deprecated void setBlock​(int x, int y, int z, int blockId, byte data)
      Deprecated.
      Uses magic values
      Set the block at x,y,z in the chunk data to blockId. Setting blocks outside the chunk's bounds does nothing.
      Parameters:
      x - the x location in the chunk from 0-15 inclusive
      y - the y location in the chunk from 0 (inclusive) - maxHeight (exclusive)
      z - the z location in the chunk from 0-15 inclusive
      blockId - the blockId to set the block to
      data - the block data to set the block to
    • getTypeId

      @Deprecated int getTypeId​(int x, int y, int z)
      Deprecated.
      Uses magic values
      Get the blockId at x,y,z in the chunk data. Getting blocks outside the chunk's bounds returns 0.
      Parameters:
      x - the x location in the chunk from 0-15 inclusive
      y - the y location in the chunk from 0 (inclusive) - maxHeight (exclusive)
      z - the z location in the chunk from 0-15 inclusive
      Returns:
      the block id or 0 if x, y or z are outside the chunk's bounds
    • getData

      @Deprecated byte getData​(int x, int y, int z)
      Deprecated.
      Uses magic values
      Get the block data at x,y,z in the chunk data. Getting blocks outside the chunk's bounds returns 0.
      Parameters:
      x - the x location in the chunk from 0-15 inclusive
      y - the y location in the chunk from 0 (inclusive) - maxHeight (exclusive)
      z - the z location in the chunk from 0-15 inclusive
      Returns:
      the block data value or air if x, y or z are outside the chunk's bounds