diff options
Diffstat (limited to 'src/Protocol')
-rw-r--r-- | src/Protocol/Protocol17x.cpp | 6 | ||||
-rw-r--r-- | src/Protocol/Protocol18x.cpp | 33 | ||||
-rw-r--r-- | src/Protocol/Protocol18x.h | 2 |
3 files changed, 20 insertions, 21 deletions
diff --git a/src/Protocol/Protocol17x.cpp b/src/Protocol/Protocol17x.cpp index 1d108ce9c..47918b5d8 100644 --- a/src/Protocol/Protocol17x.cpp +++ b/src/Protocol/Protocol17x.cpp @@ -1841,7 +1841,11 @@ void cProtocol172::HandlePacketAnimation(cByteBuffer & a_ByteBuffer) { HANDLE_READ(a_ByteBuffer, ReadBEInt, int, EntityID); HANDLE_READ(a_ByteBuffer, ReadByte, Byte, Animation); - m_Client->HandleAnimation(Animation); + + if (Animation == 1) + { + m_Client->GetPlayer()->GetWorld()->BroadcastEntityAnimation(*m_Client->GetPlayer(), 0, m_Client); + } } diff --git a/src/Protocol/Protocol18x.cpp b/src/Protocol/Protocol18x.cpp index 8170a494f..28906c7fa 100644 --- a/src/Protocol/Protocol18x.cpp +++ b/src/Protocol/Protocol18x.cpp @@ -1883,7 +1883,7 @@ bool cProtocol180::HandlePacket(cByteBuffer & a_ByteBuffer, UInt32 a_PacketType) case 0x07: HandlePacketBlockDig (a_ByteBuffer); return true; case 0x08: HandlePacketBlockPlace (a_ByteBuffer); return true; case 0x09: HandlePacketSlotSelect (a_ByteBuffer); return true; - case 0x0a: HandlePacketAnimation (a_ByteBuffer); return true; + case 0xa: HandlePacketAnimation (a_ByteBuffer); return true; case 0x0b: HandlePacketEntityAction (a_ByteBuffer); return true; case 0x0c: HandlePacketSteerVehicle (a_ByteBuffer); return true; case 0x0d: HandlePacketWindowClose (a_ByteBuffer); return true; @@ -2085,17 +2085,6 @@ void cProtocol180::HandlePacketLoginStart(cByteBuffer & a_ByteBuffer) -void cProtocol180::HandlePacketAnimation(cByteBuffer & a_ByteBuffer) -{ - HANDLE_READ(a_ByteBuffer, ReadBEInt, int, EntityID); - HANDLE_READ(a_ByteBuffer, ReadByte, Byte, Animation); - m_Client->HandleAnimation(Animation); -} - - - - - void cProtocol180::HandlePacketBlockDig(cByteBuffer & a_ByteBuffer) { HANDLE_READ(a_ByteBuffer, ReadByte, Byte, Status); @@ -2122,11 +2111,8 @@ void cProtocol180::HandlePacketBlockPlace(cByteBuffer & a_ByteBuffer) return; } - HANDLE_READ(a_ByteBuffer, ReadByte, Byte, Face); - if (Face == 255) - { - Face = 0; - } + HANDLE_READ(a_ByteBuffer, ReadByte, Byte, FaceByte); + eBlockFace Face = (FaceByte == 255) ? BLOCK_FACE_NONE : static_cast<eBlockFace>(FaceByte); cItem Item; ReadItem(a_ByteBuffer, Item, 3); @@ -2134,7 +2120,7 @@ void cProtocol180::HandlePacketBlockPlace(cByteBuffer & a_ByteBuffer) HANDLE_READ(a_ByteBuffer, ReadByte, Byte, CursorX); HANDLE_READ(a_ByteBuffer, ReadByte, Byte, CursorY); HANDLE_READ(a_ByteBuffer, ReadByte, Byte, CursorZ); - m_Client->HandleRightClick(BlockX, BlockY, BlockZ, static_cast<eBlockFace>(Face), CursorX, CursorY, CursorZ, m_Client->GetPlayer()->GetEquippedItem()); + m_Client->HandleRightClick(BlockX, BlockY, BlockZ, Face, CursorX, CursorY, CursorZ, m_Client->GetPlayer()->GetEquippedItem()); } @@ -2215,6 +2201,15 @@ void cProtocol180::HandlePacketCreativeInventoryAction(cByteBuffer & a_ByteBuffe +void cProtocol180::HandlePacketAnimation(cByteBuffer & a_ByteBuffer) +{ + m_Client->GetPlayer()->GetWorld()->BroadcastEntityAnimation(*m_Client->GetPlayer(), 0, m_Client); +} + + + + + void cProtocol180::HandlePacketEntityAction(cByteBuffer & a_ByteBuffer) { HANDLE_READ(a_ByteBuffer, ReadVarInt, UInt32, PlayerID); @@ -2431,7 +2426,7 @@ void cProtocol180::HandlePacketUseEntity(cByteBuffer & a_ByteBuffer) HANDLE_READ(a_ByteBuffer, ReadBEFloat, float, TargetY); HANDLE_READ(a_ByteBuffer, ReadBEFloat, float, TargetZ); - // TODO: Do anything + m_Client->GetPlayer()->GetWorld()->BroadcastEntityAnimation(*m_Client->GetPlayer(), 0, m_Client); break; } default: diff --git a/src/Protocol/Protocol18x.h b/src/Protocol/Protocol18x.h index 92d9825ef..77821358f 100644 --- a/src/Protocol/Protocol18x.h +++ b/src/Protocol/Protocol18x.h @@ -288,13 +288,13 @@ protected: void HandlePacketLoginStart(cByteBuffer & a_ByteBuffer); // Packet handlers while in the Game state (m_State == 3): - void HandlePacketAnimation (cByteBuffer & a_ByteBuffer); void HandlePacketBlockDig (cByteBuffer & a_ByteBuffer); void HandlePacketBlockPlace (cByteBuffer & a_ByteBuffer); void HandlePacketChatMessage (cByteBuffer & a_ByteBuffer); void HandlePacketClientSettings (cByteBuffer & a_ByteBuffer); void HandlePacketClientStatus (cByteBuffer & a_ByteBuffer); void HandlePacketCreativeInventoryAction(cByteBuffer & a_ByteBuffer); + void HandlePacketAnimation (cByteBuffer & a_ByteBuffer); void HandlePacketEntityAction (cByteBuffer & a_ByteBuffer); void HandlePacketKeepAlive (cByteBuffer & a_ByteBuffer); void HandlePacketPlayer (cByteBuffer & a_ByteBuffer); |