Add Clientbound Game Event

This commit is contained in:
Snowiiii committed 2024-08-03 11:33:50 +02:00
1 parent 1f041cc7db
commit cc527c26ea
2 files changed
+23 -2

No files matched your search

+18
View File
@@ -168,4 +168,22 @@ impl ClientPacket for CLogin {
}
}
pub struct CGameEvent {
event: u8,
value: f32,
}
impl CGameEvent {
pub fn new(event: u8, value: f32) -> Self {
Self { event, value }
}
}
impl ClientPacket for CGameEvent {
const PACKET_ID: VarInt = 0x22;
fn write(&self, bytebuf: &mut ByteBuffer) {
bytebuf.put_u8(self.event);
bytebuf.put_f32(self.value);
}
}