Skip to content

Commit

Permalink
Add Serverbound Player Input
Browse files Browse the repository at this point in the history
  • Loading branch information
Snowiiii authored and lokka30 committed Nov 7, 2024
1 parent b3c02e3 commit ff4a710
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,3 @@ Consider joining our [discord](https://discord.gg/wT8XjrjKkf) to stay up-to-date
## Funding

If you want to fund me and help the project, Check out my [GitHub sponsors](https://github.com/sponsors/Snowiiii) or my [PayPal](https://www.paypal.me/alexxmedvedev)

## Thanks

A big thanks to [wiki.vg](https://wiki.vg/) for providing valuable information used in the development of this project.
2 changes: 2 additions & 0 deletions pumpkin-protocol/src/server/play/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ mod s_player_abilities;
mod s_player_action;
mod s_player_command;
mod s_player_ground;
mod s_player_input;
mod s_player_position;
mod s_player_position_rotation;
mod s_player_rotation;
Expand All @@ -35,6 +36,7 @@ pub use s_player_abilities::*;
pub use s_player_action::*;
pub use s_player_command::*;
pub use s_player_ground::*;
pub use s_player_input::*;
pub use s_player_position::*;
pub use s_player_position_rotation::*;
pub use s_player_rotation::*;
Expand Down
8 changes: 8 additions & 0 deletions pumpkin-protocol/src/server/play/s_player_input.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
use pumpkin_macros::server_packet;

#[derive(serde::Deserialize)]
#[server_packet("play:player_input")]
pub struct SPlayerInput {
// Yep exactly how it looks like
_input: i8,
}
5 changes: 4 additions & 1 deletion pumpkin/src/entity/player.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ use pumpkin_protocol::{
},
server::play::{
SChatCommand, SChatMessage, SClientInformationPlay, SClientTickEnd, SConfirmTeleport,
SInteract, SPlayerAbilities, SPlayerAction, SPlayerCommand, SPlayerPosition,
SInteract, SPlayerAbilities, SPlayerAction, SPlayerCommand, SPlayerInput, SPlayerPosition,
SPlayerPositionRotation, SPlayerRotation, SSetCreativeSlot, SSetHeldItem, SSetPlayerGround,
SSwingArm, SUseItem, SUseItemOn,
},
Expand Down Expand Up @@ -675,6 +675,9 @@ impl Player {
self.handle_client_information(SClientInformationPlay::read(bytebuf)?)
.await;
}
SPlayerInput::PACKET_ID => {
// TODO
}
SInteract::PACKET_ID => {
self.handle_interact(SInteract::read(bytebuf)?).await;
}
Expand Down

0 comments on commit ff4a710

Please sign in to comment.