Skip to main content

Module types

Module types 

Source
Expand description

Hand-written protocol types shared by the generated packet code.

Re-exports§

pub use position::BlockPos;
pub use position::PositionLayout;

Modules§

position
Block positions packed into 64 bits.
slot
Inventory slots (item stacks) in their per-version wire formats.

Structs§

ByteString
An immutable UTF-8 encoded string using Bytes as the storage.
Uuid
A Universally Unique Identifier (UUID).

Functions§

angle_to_degrees
Converts a protocol angle byte (1/256 of a full turn) to degrees in [-180, 180).
degrees_to_angle
Converts degrees to a protocol angle byte the way vanilla does ((int)(deg * 256 / 360), truncated, then wrapped to a byte).
f64_to_fixed
Converts blocks to a 1.8-style fixed-point coordinate (floor(v * 32), like vanilla).
fixed_to_f64
Converts a 1.8-style fixed-point coordinate (1/32 block, as in spawn/teleport packets) to blocks.