Skip to content

API reference / @jsprismarine/protocol / NoiseAlignment

Class: NoiseAlignment ​

Defined in: protocol/src/structure/NoiseAlignment.ts:20

The NoiseAlignment of an EnvironmentAttributeData: how a noise-driven transition lines up its noise across the layer.

Protocol 2193 wire order: type as one byte (the NoiseAlignmentType value, which the schema marks Enum-as-Value), then value as a varuint32. The field arrived at protocol 2181; the docs do not say what value measures. https://mojang.github.io/bedrock-protocol-docs/1.26.51/types/noise-alignment/

Extends ​

Constructors ​

Constructor ​

new NoiseAlignment(type?, value?): NoiseAlignment

Defined in: protocol/src/structure/NoiseAlignment.ts:21

Parameters ​

type? ​

MIN_LOCAL_TRANSITION_END = NoiseAlignmentType.MIN_LOCAL_TRANSITION_END

type of alignment.

value? ​

number = 0

value the alignment uses; its meaning depends on type.

Returns ​

NoiseAlignment

Overrides ​

NetworkStructure.constructor

Properties ​

type ​

type: MIN_LOCAL_TRANSITION_END = NoiseAlignmentType.MIN_LOCAL_TRANSITION_END

Defined in: protocol/src/structure/NoiseAlignment.ts:23

type of alignment.


value ​

value: number = 0

Defined in: protocol/src/structure/NoiseAlignment.ts:25

value the alignment uses; its meaning depends on type.

Methods ​

deserialize() ​

deserialize(stream): void

Defined in: protocol/src/structure/NoiseAlignment.ts:37

Reads type as a byte, then value as a varuint32.

Parameters ​

stream ​

NetworkBinaryStream

Returns ​

void

Overrides ​

NetworkStructure.deserialize


serialize() ​

serialize(stream): void

Defined in: protocol/src/structure/NoiseAlignment.ts:31

Writes type as a byte, then value as a varuint32.

Parameters ​

stream ​

NetworkBinaryStream

Returns ​

void

Overrides ​

NetworkStructure.serialize


deserialize() ​

static deserialize<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 ​

NetworkBinaryStream

The binary stream to deserialize from.

Returns ​

T

An instance of the class T.

Inherited from ​

NetworkStructure.deserialize