diff options
Diffstat (limited to 'src/Protocol/Protocol18x.cpp')
-rw-r--r-- | src/Protocol/Protocol18x.cpp | 33 |
1 files changed, 14 insertions, 19 deletions
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: |