Skip to content

Commit

Permalink
Add Update Entity Position packet
Browse files Browse the repository at this point in the history
  • Loading branch information
ya7on committed Feb 26, 2024
1 parent 3b521ab commit 9945885
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/packets/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ mod spawn_entity;
mod status_response;
mod synchronize_player_position;
mod teleport_entity;
mod update_entity_position;

pub use chunk_data_and_update_light::{BlockEntity, ChunkDataAndUpdateLight};
pub use finish_configuration::FinishConfigurationClientbound;
Expand All @@ -25,3 +26,4 @@ pub use spawn_entity::{EntityType, SpawnEntity};
pub use status_response::StatusResponse;
pub use synchronize_player_position::SynchronizePlayerPosition;
pub use teleport_entity::TeleportEntity;
pub use update_entity_position::UpdateEntityPosition;
13 changes: 13 additions & 0 deletions src/packets/client/update_entity_position.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
use crate::packets::packet_ids::current_version;
use crate::types::{MCBoolean, MCShort, MCVarInt};
use crate::{MCPacket, MCType};

#[derive(MCPacket, Debug, Clone)]
#[packet(packet_id = current_version::play::client::UPDATE_ENTITY_POSITION)]
pub struct UpdateEntityPosition {
pub entity_id: MCVarInt,
pub delta_x: MCShort,
pub delta_y: MCShort,
pub delta_z: MCShort,
pub on_ground: MCBoolean,
}
1 change: 1 addition & 0 deletions src/packets/packet_ids.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ mod version_1_20_4 {
pub const PLAYER_ABILITIES: i32 = 0x36;
pub const SET_DEFAULT_SPAWN_POSITION: i32 = 0x54;
pub const SYNCHRONIZE_PLAYER_POSITION: i32 = 0x3E;
pub const UPDATE_ENTITY_POSITION: i32 = 0x2C;
pub const TELEPORT_ENTITY: i32 = 0x6D;
}
pub mod server {
Expand Down

0 comments on commit 9945885

Please sign in to comment.