Skip to main content

deepslate_protocol/
lib.rs

1//! Minecraft protocol primitives for the Deepslate proxy.
2//!
3//! This crate provides zero-copy packet encoding/decoding, `VarInt` utilities,
4//! and type definitions for the Minecraft protocol. It is intentionally
5//! I/O-free and async-free, operating only on byte slices and buffers.
6
7pub mod codec;
8pub mod packet;
9pub mod types;
10pub mod varint;
11pub mod version;
12
13/// Protocol state for a Minecraft connection.
14#[derive(Debug, Clone, Copy, PartialEq, Eq)]
15pub enum State {
16    /// Initial state: only Handshake packet is valid.
17    Handshake,
18    /// Server list ping.
19    Status,
20    /// Authentication and login.
21    Login,
22    /// Configuration phase (1.20.2+).
23    Config,
24    /// Gameplay packets.
25    Play,
26}