mirror of
https://github.com/italicsjenga/valence.git
synced 2024-12-23 14:31:30 +11:00
Added sequence where it was missing (#127)
This commit is contained in:
parent
101aa3721b
commit
4a3ee77858
|
@ -2,8 +2,8 @@
|
|||
|
||||
use std::collections::{HashSet, VecDeque};
|
||||
use std::iter::FusedIterator;
|
||||
use std::mem;
|
||||
use std::time::Duration;
|
||||
use std::{cmp, mem};
|
||||
|
||||
pub use bitfield_struct::bitfield;
|
||||
pub use event::*;
|
||||
|
@ -1034,7 +1034,7 @@ impl<C: Config> Client<C> {
|
|||
C2sPlayPacket::PlayerAbilitiesC2s(_) => {}
|
||||
C2sPlayPacket::PlayerAction(p) => {
|
||||
if p.sequence.0 != 0 {
|
||||
self.block_change_sequence = p.sequence.0;
|
||||
self.block_change_sequence = cmp::max(p.sequence.0, self.block_change_sequence);
|
||||
}
|
||||
|
||||
self.events.push_back(match p.status {
|
||||
|
@ -1112,15 +1112,25 @@ impl<C: Config> Client<C> {
|
|||
C2sPlayPacket::UpdateSign(_) => {}
|
||||
C2sPlayPacket::SwingArm(p) => self.events.push_back(ClientEvent::ArmSwing(p.hand)),
|
||||
C2sPlayPacket::TeleportToEntity(_) => {}
|
||||
C2sPlayPacket::UseItemOn(p) => self.events.push_back(ClientEvent::InteractWithBlock {
|
||||
hand: p.hand,
|
||||
location: p.location,
|
||||
face: p.face,
|
||||
cursor_pos: p.cursor_pos,
|
||||
head_inside_block: p.head_inside_block,
|
||||
sequence: p.sequence,
|
||||
}),
|
||||
C2sPlayPacket::UseItem(_) => {}
|
||||
C2sPlayPacket::UseItemOn(p) => {
|
||||
if p.sequence.0 != 0 {
|
||||
self.block_change_sequence = cmp::max(p.sequence.0, self.block_change_sequence);
|
||||
}
|
||||
|
||||
self.events.push_back(ClientEvent::InteractWithBlock {
|
||||
hand: p.hand,
|
||||
location: p.location,
|
||||
face: p.face,
|
||||
cursor_pos: p.cursor_pos,
|
||||
head_inside_block: p.head_inside_block,
|
||||
sequence: p.sequence,
|
||||
})
|
||||
}
|
||||
C2sPlayPacket::UseItem(p) => {
|
||||
if p.sequence.0 != 0 {
|
||||
self.block_change_sequence = cmp::max(p.sequence.0, self.block_change_sequence);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue