mirror of
https://github.com/Pumpkin-MC/Pumpkin.git
synced 2026-08-31 08:22:33 +00:00
fix typos 1.30 warns
This commit is contained in:
@@ -23,15 +23,15 @@ impl CSetEntityMetadata {
|
||||
#[derive(Serialize, Clone)]
|
||||
pub struct Metadata<T> {
|
||||
index: u8,
|
||||
typ: VarInt,
|
||||
r#type: VarInt,
|
||||
value: T,
|
||||
}
|
||||
|
||||
impl<T> Metadata<T> {
|
||||
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,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<f64>,
|
||||
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<f64>,
|
||||
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,
|
||||
|
||||
@@ -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<Vector3<f32>>,
|
||||
pub hand: Option<VarInt>,
|
||||
pub sneaking: bool,
|
||||
@@ -21,8 +21,8 @@ pub struct SInteract {
|
||||
impl ServerPacket for SInteract {
|
||||
fn read(bytebuf: &mut impl Buf) -> Result<Self, ReadingError> {
|
||||
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<Vector3<f32>> = 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()?,
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user