-
-
Notifications
You must be signed in to change notification settings - Fork 152
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
96 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,32 @@ | ||
use num_derive::FromPrimitive; | ||
use pumpkin_macros::packet; | ||
|
||
use crate::{position::WorldPosition, VarInt}; | ||
|
||
#[derive(serde::Deserialize)] | ||
#[allow(dead_code)] | ||
#[packet(0x24)] | ||
pub struct SPlayerAction { | ||
status: VarInt, | ||
location: WorldPosition, | ||
face: u8, | ||
sequence: VarInt, | ||
pub status: VarInt, | ||
pub location: WorldPosition, | ||
pub face: u8, | ||
pub sequence: VarInt, | ||
} | ||
|
||
#[derive(FromPrimitive)] | ||
pub enum Status { | ||
/// Sent when the player starts digging a block. If the block was instamined or the player is in creative mode, the client will not send Status = Finished digging, and will assume the server completed the destruction. To detect this, it is necessary to calculate the block destruction speed server-side. | ||
StartedDigging = 0, | ||
/// Sent when the player lets go of the Mine Block key (default: left click). Face is always set to -Y. | ||
CancelledDigging, | ||
/// Sent when the client thinks it is finished. | ||
FinishedDigging, | ||
/// Triggered by using the Drop Item key (default: Q) with the modifier to drop the entire selected stack (default: Control or Command, depending on OS). Location is always set to 0/0/0, Face is always set to -Y. Sequence is always set to 0. | ||
DropItemStack, | ||
/// Triggered by using the Drop Item key (default: Q). Location is always set to 0/0/0, Face is always set to -Y. Sequence is always set to 0. | ||
DropItem, | ||
/// I didn't make that up | ||
/// Indicates that the currently held item should have its state updated such as eating food, pulling back bows, using buckets, etc. Location is always set to 0/0/0, Face is always set to -Y. Sequence is always set to 0. | ||
ShootArrowOrFinishEating, | ||
/// Used to swap or assign an item to the second hand. Location is always set to 0/0/0, Face is always set to -Y. Sequence is always set to 0. | ||
SwapItem, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters