API reference / @jsprismarine/protocol / ChunkPos
Class: ChunkPos
Defined in: protocol/src/structure/ChunkPos.ts:8
A chunk column position: X then Z, both ZigZag varint32, counted in chunks. https://mojang.github.io/bedrock-protocol-docs/1.26.51/types/chunk-pos/
Extends
Constructors
Constructor
new ChunkPos(
cx,cz):ChunkPos
Defined in: protocol/src/structure/ChunkPos.ts:9
Parameters
cx
number
cz
number
Returns
ChunkPos
Overrides
Properties
cx
cx:
number
Defined in: protocol/src/structure/ChunkPos.ts:10
cz
cz:
number
Defined in: protocol/src/structure/ChunkPos.ts:11
Methods
deserialize()
deserialize(
stream):void
Defined in: protocol/src/structure/ChunkPos.ts:21
Deserializes the network structure from a binary stream.
Parameters
stream
The binary stream to deserialize from.
Returns
void
Overrides
serialize()
serialize(
stream):void
Defined in: protocol/src/structure/ChunkPos.ts:16
Serializes the network structure to a binary stream.
Parameters
stream
The binary stream to serialize to.
Returns
void
Overrides
deserialize()
staticdeserialize<T>(this,stream):T
Defined in: protocol/src/NetworkStructure.ts:28
Deserializes the network structure from a binary stream. The constructor runs with no arguments before the stream is read, so the class must tolerate that.
Type Parameters
T
T extends NetworkStructure
Parameters
this
Constructor<T>
stream
The binary stream to deserialize from.
Returns
T
An instance of the class T.