Package org.geysermc.geyser.util
Class ChunkUtils
java.lang.Object
org.geysermc.geyser.util.ChunkUtils
-
Field Summary
Modifier and TypeFieldDescriptionstatic byte[]
static byte[]
An empty chunk that can be safely passed on to a LevelChunkPacket with subcounts set to 0.static int
The maximum chunk height Bedrock Edition will accept, from the lowest point to the highest.static int
static int
The minimum height Bedrock Edition will accept.static int
static byte[]
An empty subchunk. -
Method Summary
Modifier and TypeMethodDescriptionstatic int
indexYZXtoXZY(int yzx)
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.static void
sendEmptyChunks(GeyserSession session, com.nukkitx.math.vector.Vector3i position, int radius, boolean forceUpdate)
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.static void
updateBlock(GeyserSession session, int blockState, com.nukkitx.math.vector.Vector3i position)
Sends a block update to the Bedrock client.static void
updateChunkPosition(GeyserSession session, com.nukkitx.math.vector.Vector3i position)
-
Field Details
-
MINIMUM_ACCEPTED_HEIGHT
public static final int MINIMUM_ACCEPTED_HEIGHTThe 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_HEIGHTThe 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_DATAAn empty subchunk. -
EMPTY_CHUNK_DATA
public static final byte[] EMPTY_CHUNK_DATAAn 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 toblockState
- the Java block state of the blockposition
- 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 toblockState
- the Java block state of the blockposition
- 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
-