diff --git a/pumpkin-protocol/src/client/play/entity_metadata.rs b/pumpkin-protocol/src/client/play/entity_metadata.rs index aac619260..f3d9e5f47 100644 --- a/pumpkin-protocol/src/client/play/entity_metadata.rs +++ b/pumpkin-protocol/src/client/play/entity_metadata.rs @@ -23,15 +23,15 @@ impl CSetEntityMetadata { #[derive(Serialize, Clone)] pub struct Metadata { index: u8, - typ: VarInt, + r#type: VarInt, value: T, } impl Metadata { - pub fn new(index: u8, typ: MetaDataType, value: T) -> Self { + pub fn new(index: u8, r#type: MetaDataType, value: T) -> Self { Self { index, - typ: VarInt(typ as i32), + r#type: VarInt(r#type as i32), value, } } diff --git a/pumpkin-protocol/src/client/play/spawn_entity.rs b/pumpkin-protocol/src/client/play/spawn_entity.rs index aaaea77cb..4fbc86511 100644 --- a/pumpkin-protocol/src/client/play/spawn_entity.rs +++ b/pumpkin-protocol/src/client/play/spawn_entity.rs @@ -11,7 +11,7 @@ pub struct CSpawnEntity { entity_id: VarInt, #[serde(with = "uuid::serde::compact")] entity_uuid: uuid::Uuid, - typ: VarInt, + r#type: VarInt, position: Vector3, pitch: u8, // angle yaw: u8, // angle @@ -25,7 +25,7 @@ impl CSpawnEntity { pub fn new( entity_id: VarInt, entity_uuid: uuid::Uuid, - typ: VarInt, + r#type: VarInt, position: Vector3, pitch: f32, // angle yaw: f32, // angle @@ -36,7 +36,7 @@ impl CSpawnEntity { Self { entity_id, entity_uuid, - typ, + r#type, position, pitch: (pitch * 256.0 / 360.0).floor() as u8, yaw: (yaw * 256.0 / 360.0).floor() as u8, diff --git a/pumpkin-protocol/src/server/play/interact.rs b/pumpkin-protocol/src/server/play/interact.rs index 17e4fac47..f310a6b42 100644 --- a/pumpkin-protocol/src/server/play/interact.rs +++ b/pumpkin-protocol/src/server/play/interact.rs @@ -11,7 +11,7 @@ use crate::{ #[packet(PLAY_INTERACT)] pub struct SInteract { pub entity_id: VarInt, - pub typ: VarInt, + pub r#type: VarInt, pub target_position: Option>, pub hand: Option, pub sneaking: bool, @@ -21,8 +21,8 @@ pub struct SInteract { impl ServerPacket for SInteract { fn read(bytebuf: &mut impl Buf) -> Result { let entity_id = bytebuf.try_get_var_int()?; - let typ = bytebuf.try_get_var_int()?; - let action = ActionType::try_from(typ.0) + let r#type = bytebuf.try_get_var_int()?; + let action = ActionType::try_from(r#type.0) .map_err(|_| ReadingError::Message("invalid action type".to_string()))?; let target_position: Option> = match action { ActionType::Interact => None, @@ -41,7 +41,7 @@ impl ServerPacket for SInteract { Ok(Self { entity_id, - typ, + r#type, target_position, hand, sneaking: bytebuf.try_get_bool()?, diff --git a/pumpkin/src/net/packet/play.rs b/pumpkin/src/net/packet/play.rs index 3996ac9d6..2e791b128 100644 --- a/pumpkin/src/net/packet/play.rs +++ b/pumpkin/src/net/packet/play.rs @@ -744,7 +744,7 @@ impl Player { if entity.sneaking.load(std::sync::atomic::Ordering::Relaxed) != sneaking { entity.set_sneaking(sneaking).await; } - let Ok(action) = ActionType::try_from(interact.typ.0) else { + let Ok(action) = ActionType::try_from(interact.r#type.0) else { self.kick(TextComponent::text("Invalid action type")).await; return; };