mirror of
https://github.com/Pumpkin-MC/Pumpkin.git
synced 2026-08-31 08:22:33 +00:00
Add s_player_action packet
Note: this packet is currently only parsed, not handled.
This commit is contained in:
@@ -8,6 +8,7 @@ mod s_player_position;
|
||||
mod s_player_position_rotation;
|
||||
mod s_player_rotation;
|
||||
mod s_swing_arm;
|
||||
mod s_player_action;
|
||||
|
||||
pub use c_client_information::*;
|
||||
pub use c_interact::*;
|
||||
@@ -19,3 +20,4 @@ pub use s_player_position::*;
|
||||
pub use s_player_position_rotation::*;
|
||||
pub use s_player_rotation::*;
|
||||
pub use s_swing_arm::*;
|
||||
pub use s_player_action::*;
|
||||
|
||||
12
pumpkin-protocol/src/server/play/s_player_action.rs
Normal file
12
pumpkin-protocol/src/server/play/s_player_action.rs
Normal file
@@ -0,0 +1,12 @@
|
||||
use pumpkin_macros::packet;
|
||||
|
||||
use crate::{position::WorldPosition, VarInt};
|
||||
|
||||
#[derive(serde::Deserialize)]
|
||||
#[packet(0x24)]
|
||||
pub struct SPlayerAction {
|
||||
status: VarInt,
|
||||
location: WorldPosition,
|
||||
face: u8,
|
||||
sequence: VarInt,
|
||||
}
|
||||
@@ -28,7 +28,8 @@ use pumpkin_protocol::{
|
||||
login::{SEncryptionResponse, SLoginAcknowledged, SLoginPluginResponse, SLoginStart},
|
||||
play::{
|
||||
SChatCommand, SChatMessage, SClientInformationPlay, SConfirmTeleport, SInteract,
|
||||
SPlayerCommand, SPlayerPosition, SPlayerPositionRotation, SPlayerRotation, SSwingArm,
|
||||
SPlayerAction, SPlayerCommand, SPlayerPosition, SPlayerPositionRotation,
|
||||
SPlayerRotation, SSwingArm,
|
||||
},
|
||||
status::{SPingRequest, SStatusRequest},
|
||||
},
|
||||
@@ -286,8 +287,9 @@ impl Client {
|
||||
server,
|
||||
SClientInformationPlay::read(bytebuf).unwrap(),
|
||||
),
|
||||
SInteract::PACKET_ID => {
|
||||
self.handle_interact(server, SInteract::read(bytebuf).unwrap());
|
||||
SInteract::PACKET_ID => self.handle_interact(server, SInteract::read(bytebuf).unwrap()),
|
||||
SPlayerAction::PACKET_ID => {
|
||||
self.handle_player_action(server, SPlayerAction::read(bytebuf).unwrap())
|
||||
}
|
||||
_ => log::error!("Failed to handle player packet id {}", packet.id.0),
|
||||
}
|
||||
|
||||
@@ -8,7 +8,8 @@ use pumpkin_protocol::{
|
||||
},
|
||||
server::play::{
|
||||
SChatCommand, SChatMessage, SClientInformationPlay, SConfirmTeleport, SInteract,
|
||||
SPlayerCommand, SPlayerPosition, SPlayerPositionRotation, SPlayerRotation, SSwingArm,
|
||||
SPlayerAction, SPlayerCommand, SPlayerPosition, SPlayerPositionRotation, SPlayerRotation,
|
||||
SSwingArm,
|
||||
},
|
||||
VarInt,
|
||||
};
|
||||
@@ -277,4 +278,5 @@ impl Client {
|
||||
}
|
||||
}
|
||||
}
|
||||
pub fn handle_player_action(&mut self, _server: &mut Server, player_action: SPlayerAction) {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user