Class ChunkUtils

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

public final class ChunkUtils extends Object
  • Field Details

    • MINIMUM_ACCEPTED_HEIGHT

      public static final int MINIMUM_ACCEPTED_HEIGHT
      The minimum height Bedrock Edition will accept.
      See Also:
      Constant Field Values
    • MINIMUM_ACCEPTED_HEIGHT_OVERWORLD

      public static final int MINIMUM_ACCEPTED_HEIGHT_OVERWORLD
      See Also:
      Constant Field Values
    • MAXIMUM_ACCEPTED_HEIGHT

      public static final int MAXIMUM_ACCEPTED_HEIGHT
      The maximum chunk height Bedrock Edition will accept, from the lowest point to the highest.
      See Also:
      Constant Field Values
    • MAXIMUM_ACCEPTED_HEIGHT_OVERWORLD

      public static final int MAXIMUM_ACCEPTED_HEIGHT_OVERWORLD
      See Also:
      Constant Field Values
    • 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
  • 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.github.steveice10.mc.protocol.data.game.entity.metadata.Position position)
      Sends a block update to the Bedrock client. If chunk caching is enabled and 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
    • updateBlock

      public static void updateBlock(GeyserSession session, int blockState, com.nukkitx.math.vector.Vector3i position)
      Sends a block update to the Bedrock client. If chunk caching is enabled and 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
    • sendEmptyChunks

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

      public static void loadDimensionTag(GeyserSession session, com.github.steveice10.opennbt.tag.builtin.CompoundTag dimensionTag)
      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