Class ChunkUtils

java.lang.Object
org.geysermc.geyser.util.ChunkUtils

public class ChunkUtils extends Object
  • Field Details

    • SERIALIZED_CHUNK_DATA

      public static final byte[] SERIALIZED_CHUNK_DATA
      An empty subchunk.
    • EMPTY_CHUNK_DATA

      public static final byte[] EMPTY_CHUNK_DATA
      An empty chunk that can be safely passed on to a LevelChunkPacket with subcounts set to 0.
    • EMPTY_BIOME_DATA

      public static final byte[] EMPTY_BIOME_DATA
  • Constructor Details

    • ChunkUtils

      public ChunkUtils()
  • Method Details

    • indexYZXtoXZY

      public static int indexYZXtoXZY(int yzx)
    • updateChunkPosition

      public static void updateChunkPosition(GeyserSession session, com.nukkitx.math.vector.Vector3i position)
    • updateBlock

      public static void updateBlock(GeyserSession session, int blockState, com.nukkitx.math.vector.Vector3i position)
      Sends a block update to the Bedrock client. If the platform is not Spigot, this also adds that block to the cache.
      Parameters:
      session - the Bedrock session to send/register the block to
      blockState - the Java block state of the block
      position - the position of the block
    • sendEmptyChunk

      public static void sendEmptyChunk(GeyserSession session, int chunkX, int chunkZ, boolean forceUpdate)
    • sendEmptyChunks

      public static void sendEmptyChunks(GeyserSession session, com.nukkitx.math.vector.Vector3i position, int radius, boolean forceUpdate)
    • loadDimension

      public static void loadDimension(GeyserSession session)
      Process the minimum and maximum heights for this dimension, and processes the world coordinate scale. This must be done after the player has switched dimensions so we know what their dimension is