Pumpkin/pumpkin-protocol/src/java/client/play/game_event.rs
Alexander Medvedev e0c91b3edc Initial Bedrock support
You can't join the World, But the base is ready
2025-06-29 00:33:44 +02:00

38 lines
801 B
Rust

use pumpkin_data::packet::clientbound::PLAY_GAME_EVENT;
use pumpkin_macros::packet;
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize)]
#[packet(PLAY_GAME_EVENT)]
pub struct CGameEvent {
event: u8,
value: f32,
}
/// You need to implement all the random stuff somewhere, right?
impl CGameEvent {
pub fn new(event: GameEvent, value: f32) -> Self {
Self {
event: event as u8,
value,
}
}
}
pub enum GameEvent {
NoRespawnBlockAvailable,
BeginRaining,
EndRaining,
ChangeGameMode,
WinGame,
DemoEvent,
ArrowHitPlayer,
RainLevelChange,
ThunderLevelChange,
PlayPufferfishStringSound,
PlayElderGuardianMobAppearance,
EnabledRespawnScreen,
LimitedCrafting,
StartWaitingChunks,
}