steel_protocol/packets/game/c_bundle_delimiter.rs
1//! Clientbound bundle delimiter packet - marks the start/end of a packet bundle.
2//!
3//! Packets sent between two bundle delimiters are processed atomically by the client
4//! in a single game tick. This is used for entity spawning to ensure all related
5//! packets (spawn, metadata, equipment, etc.) are applied together.
6
7use steel_macros::{ClientPacket, WriteTo};
8use steel_registry::packets::play::C_BUNDLE_DELIMITER;
9
10/// Marks the start or end of a packet bundle.
11///
12/// When the client receives this packet, it toggles bundle mode:
13/// - First delimiter: Start collecting packets
14/// - Second delimiter: Process all collected packets atomically
15///
16/// This packet has no fields - it's purely a marker.
17#[derive(ClientPacket, WriteTo, Clone, Debug, Default)]
18#[packet_id(Play = C_BUNDLE_DELIMITER)]
19pub struct CBundleDelimiter;
20
21impl CBundleDelimiter {
22 /// Creates a new bundle delimiter packet.
23 #[must_use]
24 pub const fn new() -> Self {
25 Self
26 }
27}