Handle invalid player commands

This commit is contained in:
Snowiiii committed 2024-08-15 16:09:49 +02:00
1 parent eeefd1d51a
commit 740a98a068
2 files changed
+19 -15

No files matched your search

@@ -7,7 +7,7 @@ use crate::{bytebuf::DeserializerError, ServerPacket, VarInt};
#[packet(0x25)]
pub struct SPlayerCommand {
pub entitiy_id: VarInt,
pub action: Action,
pub action: VarInt,
pub jump_boost: VarInt,
}
#[derive(FromPrimitive)]
@@ -27,7 +27,7 @@ impl ServerPacket for SPlayerCommand {
fn read(bytebuf: &mut crate::bytebuf::ByteBuffer) -> Result<Self, DeserializerError> {
Ok(Self {
entitiy_id: bytebuf.get_var_int(),
action: Action::from_i32(bytebuf.get_var_int().into()).unwrap(),
action: bytebuf.get_var_int(),
jump_boost: bytebuf.get_var_int(),
})
}