Package org.bukkit

Interface ChunkSnapshot


public interface ChunkSnapshot
Represents a static, thread-safe snapshot of chunk of blocks.

Purpose is to allow clean, efficient copy of a chunk data to be made, and then handed off for processing in another thread (e.g. map rendering)

  • Method Summary Link icon

    Modifier and Type
    Method
    Description
    boolean
    contains(Biome biome)
    Tests if this chunk contains the specified biome.
    boolean
    Tests if this snapshot contains the specified block.
    getBiome(int x, int z)
    Deprecated.
    biomes are now 3-dimensional
    getBiome(int x, int y, int z)
    Get biome at given coordinates
    getBlockData(int x, int y, int z)
    Get block data for block at corresponding coordinate in the chunk
    int
    getBlockEmittedLight(int x, int y, int z)
    Get light level emitted by block at corresponding coordinate in the chunk
    int
    getBlockSkyLight(int x, int y, int z)
    Get sky light level for block at corresponding coordinate in the chunk
    getBlockType(int x, int y, int z)
    Get block type for block at corresponding coordinate in the chunk
    long
    Get world full time when chunk snapshot was captured
    int
    getData(int x, int y, int z)
    Deprecated.
    Magic value
    int
    getHighestBlockYAt(int x, int z)
    Gets the highest non-air coordinate at the given coordinates
    double
    getRawBiomeTemperature(int x, int z)
    Deprecated.
    biomes are now 3-dimensional
    double
    getRawBiomeTemperature(int x, int y, int z)
    Get raw biome temperature at given coordinates
    Gets name of the world containing this chunk
    int
    Gets the X-coordinate of this chunk
    int
    Gets the Z-coordinate of this chunk
    boolean
    Test if section is empty
  • Method Details Link icon

    • getX Link icon

      int getX()
      Gets the X-coordinate of this chunk
      Returns:
      X-coordinate
    • getZ Link icon

      int getZ()
      Gets the Z-coordinate of this chunk
      Returns:
      Z-coordinate
    • getWorldName Link icon

      @NotNull String getWorldName()
      Gets name of the world containing this chunk
      Returns:
      Parent World Name
    • getBlockType Link icon

      @NotNull Material getBlockType(int x, int y, int z)
      Get block type for block at corresponding coordinate in the chunk
      Parameters:
      x - 0-15
      y - world minHeight (inclusive) - world maxHeight (exclusive)
      z - 0-15
      Returns:
      block material type
    • getBlockData Link icon

      @NotNull BlockData getBlockData(int x, int y, int z)
      Get block data for block at corresponding coordinate in the chunk
      Parameters:
      x - 0-15
      y - world minHeight (inclusive) - world maxHeight (exclusive)
      z - 0-15
      Returns:
      block material type
    • getData Link icon

      @Deprecated(since="1.6.2") int getData(int x, int y, int z)
      Deprecated.
      Magic value
      Get block data for block at corresponding coordinate in the chunk
      Parameters:
      x - 0-15
      y - world minHeight (inclusive) - world maxHeight (exclusive)
      z - 0-15
      Returns:
      0-15
    • getBlockSkyLight Link icon

      int getBlockSkyLight(int x, int y, int z)
      Get sky light level for block at corresponding coordinate in the chunk
      Parameters:
      x - 0-15
      y - world minHeight (inclusive) - world maxHeight (exclusive)
      z - 0-15
      Returns:
      0-15
    • getBlockEmittedLight Link icon

      int getBlockEmittedLight(int x, int y, int z)
      Get light level emitted by block at corresponding coordinate in the chunk
      Parameters:
      x - 0-15
      y - world minHeight (inclusive) - world maxHeight (exclusive)
      z - 0-15
      Returns:
      0-15
    • getHighestBlockYAt Link icon

      int getHighestBlockYAt(int x, int z)
      Gets the highest non-air coordinate at the given coordinates
      Parameters:
      x - X-coordinate of the blocks (0-15)
      z - Z-coordinate of the blocks (0-15)
      Returns:
      Y-coordinate of the highest non-air block
    • getBiome Link icon

      @NotNull @Deprecated(since="1.15") Biome getBiome(int x, int z)
      Deprecated.
      biomes are now 3-dimensional
      Get biome at given coordinates
      Parameters:
      x - X-coordinate (0-15)
      z - Z-coordinate (0-15)
      Returns:
      Biome at given coordinate
    • getBiome Link icon

      @NotNull Biome getBiome(int x, int y, int z)
      Get biome at given coordinates
      Parameters:
      x - X-coordinate (0-15)
      y - Y-coordinate (world minHeight (inclusive) - world maxHeight (exclusive))
      z - Z-coordinate (0-15)
      Returns:
      Biome at given coordinate
    • getRawBiomeTemperature Link icon

      @Deprecated(since="1.15") double getRawBiomeTemperature(int x, int z)
      Deprecated.
      biomes are now 3-dimensional
      Get raw biome temperature at given coordinates
      Parameters:
      x - X-coordinate (0-15)
      z - Z-coordinate (0-15)
      Returns:
      temperature at given coordinate
    • getRawBiomeTemperature Link icon

      double getRawBiomeTemperature(int x, int y, int z)
      Get raw biome temperature at given coordinates
      Parameters:
      x - X-coordinate (0-15)
      y - Y-coordinate (0-15)
      z - Z-coordinate (0-15)
      Returns:
      temperature at given coordinate
    • getCaptureFullTime Link icon

      long getCaptureFullTime()
      Get world full time when chunk snapshot was captured
      Returns:
      time in ticks
    • isSectionEmpty Link icon

      boolean isSectionEmpty(int sy)
      Test if section is empty
      Parameters:
      sy - - section Y coordinate (block Y / 16, world minHeight (inclusive) - world maxHeight (exclusive))
      Returns:
      true if empty, false if not
    • contains Link icon

      boolean contains(@NotNull BlockData block)
      Tests if this snapshot contains the specified block.
      Parameters:
      block - block to test
      Returns:
      if the block is contained within
    • contains Link icon

      boolean contains(@NotNull Biome biome)
      Tests if this chunk contains the specified biome.
      Parameters:
      biome - biome to test
      Returns:
      if the biome is contained within