1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
//! Minecraft Java Edition network protocol for the ghast client library.
//!
//! Layers, bottom to top:
//!
//! - [`codec`]: bounds-checked [`Reader`] over [`bytes::Bytes`] (zero-copy byte arrays
//! and strings), [`McWrite`] for encoding, VarInt/VarLong.
//! - [`types`], [`nbt`], [`chat`]: hand-written shared types — [`BlockPos`] with the
//! per-version bit layout, slots, lazily parsed NBT ([`nbt::RawNbt`]), chat JSON.
//! - Generated packet modules per protocol version ([`v1_8`] = protocol 47,
//! [`v1_16_5`] = protocol 754), each with typed packet structs, one enum per state and
//! direction, and id constants. A [`Version`] marker type ties a version's packet sets
//! together so a version-agnostic layer can be written generically.
//! - [`frame`]: length framing, zlib compression with partial inflation, the
//! AES-128-CFB8 hook ([`crypto`]), and the per-id [`PacketFilter`] that drops unwanted
//! packets before they are decoded.
//! - [`io`] (feature `tokio`): async framed reader/writer.
//!
//! Decoding never panics on untrusted input: every failure is a [`DecodeError`] or
//! [`FrameError`], and allocations are bounded by the input size.
//!
//! ```
//! use ghast_protocol::{FrameDecoder, FrameEncoder, PacketSet, RawPacket};
//! use ghast_protocol::v1_8::play::serverbound::{KeepAlive, ServerboundPlayPacket};
//!
//! let mut enc = FrameEncoder::new();
//! enc.write_packet(&KeepAlive { keep_alive_id: 42 }).unwrap();
//! let mut dec = FrameDecoder::new();
//! dec.push(&enc.take());
//! let raw: RawPacket = dec.next_packet().unwrap().unwrap();
//! let p = ServerboundPlayPacket::decode_raw(&raw).unwrap();
//! assert_eq!(p, ServerboundPlayPacket::KeepAlive(KeepAlive { keep_alive_id: 42 }));
//! ```
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use BlockPos;