steel_protocol/packets/game/c_ticking_step.rs
1use steel_macros::{ClientPacket, WriteTo};
2use steel_registry::packets::play::C_TICKING_STEP;
3
4/// Packet sent to clients to inform them of the number of frozen ticks to run.
5/// This is used when stepping forward while the server is frozen.
6#[derive(WriteTo, ClientPacket, Clone, Debug)]
7#[packet_id(Play = C_TICKING_STEP)]
8pub struct CTickingStep {
9 /// The number of ticks to step forward.
10 #[write(as = VarInt)]
11 pub tick_steps: i32,
12}
13
14impl CTickingStep {
15 /// Creates a new ticking step packet.
16 #[must_use]
17 pub const fn new(tick_steps: i32) -> Self {
18 Self { tick_steps }
19 }
20}