World: Add GZip compression

This commit is contained in:
Snowiiii committed 2024-08-16 11:10:16 +02:00
1 parent 94a7a60423
commit 231bdb5614
8 files changed
+90 -64

No files matched your search

@@ -1,9 +1,10 @@
use pumpkin_macros::packet;
use pumpkin_text::TextComponent;
use serde::Serialize;
use crate::{ClientPacket, VarInt};
use crate::VarInt;
#[derive(Clone)]
#[derive(Serialize)]
#[packet(0x1E)]
pub struct CDisguisedChatMessage {
message: TextComponent,
@@ -27,12 +28,3 @@ impl CDisguisedChatMessage {
}
}
}
impl ClientPacket for CDisguisedChatMessage {
fn write(&self, bytebuf: &mut crate::bytebuf::ByteBuffer) {
bytebuf.put_slice(&self.message.encode());
bytebuf.put_var_int(&self.chat_type);
bytebuf.put_slice(&self.sender_name.encode());
bytebuf.put_option(&self.target_name, |p, v| p.put_slice(&v.encode()));
}
}