From 849438832477db2254d88bf5f9e6561d98e7e378 Mon Sep 17 00:00:00 2001 From: StripedMonkey Date: Tue, 20 Aug 2024 19:56:17 -0400 Subject: [PATCH] entitiy -> entity --- pumpkin-protocol/src/client/play/c_entity_velocity.rs | 6 +++--- pumpkin-protocol/src/client/play/c_hurt_animation.rs | 6 +++--- pumpkin-protocol/src/client/play/c_remove_entities.rs | 8 ++++---- ...date_entitiy_pos_rot.rs => c_update_entity_pos_rot.rs} | 0 pumpkin-protocol/src/client/play/mod.rs | 3 +-- pumpkin-protocol/src/server/play/s_player_command.rs | 4 ++-- pumpkin/src/client/player_packet.rs | 4 ++-- 7 files changed, 15 insertions(+), 16 deletions(-) rename pumpkin-protocol/src/client/play/{c_update_entitiy_pos_rot.rs => c_update_entity_pos_rot.rs} (100%) diff --git a/pumpkin-protocol/src/client/play/c_entity_velocity.rs b/pumpkin-protocol/src/client/play/c_entity_velocity.rs index 842fc1cda..fcfdccd59 100644 --- a/pumpkin-protocol/src/client/play/c_entity_velocity.rs +++ b/pumpkin-protocol/src/client/play/c_entity_velocity.rs @@ -6,16 +6,16 @@ use crate::VarInt; #[derive(Serialize)] #[packet(0x5A)] pub struct CEntityVelocity<'a> { - entitiy_id: &'a VarInt, + entity_id: &'a VarInt, velocity_x: i16, velocity_y: i16, velocity_z: i16, } impl<'a> CEntityVelocity<'a> { - pub fn new(entitiy_id: &'a VarInt, velocity_x: f32, velocity_y: f32, velocity_z: f32) -> Self { + pub fn new(entity_id: &'a VarInt, velocity_x: f32, velocity_y: f32, velocity_z: f32) -> Self { Self { - entitiy_id, + entity_id, velocity_x: (velocity_x.clamp(-3.9, 3.9) * 8000.0) as i16, velocity_y: (velocity_y.clamp(-3.9, 3.9) * 8000.0) as i16, velocity_z: (velocity_z.clamp(-3.9, 3.9) * 8000.0) as i16, diff --git a/pumpkin-protocol/src/client/play/c_hurt_animation.rs b/pumpkin-protocol/src/client/play/c_hurt_animation.rs index 6166acbd3..2b1b04d8f 100644 --- a/pumpkin-protocol/src/client/play/c_hurt_animation.rs +++ b/pumpkin-protocol/src/client/play/c_hurt_animation.rs @@ -6,12 +6,12 @@ use crate::VarInt; #[derive(Serialize)] #[packet(0x24)] pub struct CHurtAnimation<'a> { - entitiy_id: &'a VarInt, + entity_id: &'a VarInt, yaw: f32, } impl<'a> CHurtAnimation<'a> { - pub fn new(entitiy_id: &'a VarInt, yaw: f32) -> Self { - Self { entitiy_id, yaw } + pub fn new(entity_id: &'a VarInt, yaw: f32) -> Self { + Self { entity_id, yaw } } } diff --git a/pumpkin-protocol/src/client/play/c_remove_entities.rs b/pumpkin-protocol/src/client/play/c_remove_entities.rs index 9e89ec260..1b16ad92e 100644 --- a/pumpkin-protocol/src/client/play/c_remove_entities.rs +++ b/pumpkin-protocol/src/client/play/c_remove_entities.rs @@ -7,14 +7,14 @@ use crate::VarInt; #[packet(0x42)] pub struct CRemoveEntities<'a> { count: VarInt, - entitiy_ids: &'a [VarInt], + entity_ids: &'a [VarInt], } impl<'a> CRemoveEntities<'a> { - pub fn new(entitiy_ids: &'a [VarInt]) -> Self { + pub fn new(entity_ids: &'a [VarInt]) -> Self { Self { - count: VarInt(entitiy_ids.len() as i32), - entitiy_ids, + count: VarInt(entity_ids.len() as i32), + entity_ids, } } } diff --git a/pumpkin-protocol/src/client/play/c_update_entitiy_pos_rot.rs b/pumpkin-protocol/src/client/play/c_update_entity_pos_rot.rs similarity index 100% rename from pumpkin-protocol/src/client/play/c_update_entitiy_pos_rot.rs rename to pumpkin-protocol/src/client/play/c_update_entity_pos_rot.rs diff --git a/pumpkin-protocol/src/client/play/mod.rs b/pumpkin-protocol/src/client/play/mod.rs index 2e15aa978..a5a2a097b 100644 --- a/pumpkin-protocol/src/client/play/mod.rs +++ b/pumpkin-protocol/src/client/play/mod.rs @@ -31,7 +31,6 @@ mod c_subtitle; mod c_sync_player_position; mod c_system_chat_message; mod c_unload_chunk; -mod c_update_entitiy_pos_rot; mod c_update_entity_pos; mod c_update_entity_rot; mod c_worldevent; @@ -70,8 +69,8 @@ pub use c_subtitle::*; pub use c_sync_player_position::*; pub use c_system_chat_message::*; pub use c_unload_chunk::*; -pub use c_update_entitiy_pos_rot::*; pub use c_update_entity_pos::*; +pub use c_update_entity_pos_rot::*; pub use c_update_entity_rot::*; pub use c_worldevent::*; pub use player_action::*; diff --git a/pumpkin-protocol/src/server/play/s_player_command.rs b/pumpkin-protocol/src/server/play/s_player_command.rs index 9399e25ce..f6365cc02 100644 --- a/pumpkin-protocol/src/server/play/s_player_command.rs +++ b/pumpkin-protocol/src/server/play/s_player_command.rs @@ -5,7 +5,7 @@ use crate::{bytebuf::DeserializerError, ServerPacket, VarInt}; #[packet(0x25)] pub struct SPlayerCommand { - pub entitiy_id: VarInt, + pub entity_id: VarInt, pub action: VarInt, pub jump_boost: VarInt, } @@ -25,7 +25,7 @@ pub enum Action { impl ServerPacket for SPlayerCommand { fn read(bytebuf: &mut crate::bytebuf::ByteBuffer) -> Result { Ok(Self { - entitiy_id: bytebuf.get_var_int(), + entity_id: bytebuf.get_var_int(), action: bytebuf.get_var_int(), jump_boost: bytebuf.get_var_int(), }) diff --git a/pumpkin/src/client/player_packet.rs b/pumpkin/src/client/player_packet.rs index 8e82c8935..a1b4273ec 100644 --- a/pumpkin/src/client/player_packet.rs +++ b/pumpkin/src/client/player_packet.rs @@ -176,7 +176,7 @@ impl Client { pub fn handle_player_command(&mut self, _server: &mut Server, command: SPlayerCommand) { let player = self.player.as_mut().unwrap(); - if command.entitiy_id != player.entity.entity_id.into() { + if command.entity_id != player.entity.entity_id.into() { return; } @@ -317,7 +317,7 @@ impl Client { } if config.swing {} } else { - self.kick("Interacted with invalid entitiy id") + self.kick("Interacted with invalid entity id") } } }