diff options
author | Howaner <franzi.moos@googlemail.com> | 2014-09-08 20:12:43 +0200 |
---|---|---|
committer | Howaner <franzi.moos@googlemail.com> | 2014-09-08 20:12:43 +0200 |
commit | 76fa3a7ccd69aee7293a19dc06c327020d3cf908 (patch) | |
tree | 01173745cf4ab3ff1b4c30df1498373159ff4986 /src | |
parent | Recoded cProtocol180 class. (diff) | |
download | cuberite-76fa3a7ccd69aee7293a19dc06c327020d3cf908.tar cuberite-76fa3a7ccd69aee7293a19dc06c327020d3cf908.tar.gz cuberite-76fa3a7ccd69aee7293a19dc06c327020d3cf908.tar.bz2 cuberite-76fa3a7ccd69aee7293a19dc06c327020d3cf908.tar.lz cuberite-76fa3a7ccd69aee7293a19dc06c327020d3cf908.tar.xz cuberite-76fa3a7ccd69aee7293a19dc06c327020d3cf908.tar.zst cuberite-76fa3a7ccd69aee7293a19dc06c327020d3cf908.zip |
Diffstat (limited to '')
-rw-r--r-- | src/ClientHandle.cpp | 12 | ||||
-rw-r--r-- | src/Protocol/Protocol17x.cpp | 2 | ||||
-rw-r--r-- | src/Protocol/Protocol18x.cpp | 5 |
3 files changed, 7 insertions, 12 deletions
diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp index 4c36dec4d..a614d5597 100644 --- a/src/ClientHandle.cpp +++ b/src/ClientHandle.cpp @@ -1198,19 +1198,9 @@ void cClientHandle::HandleRightClick(int a_BlockX, int a_BlockY, int a_BlockZ, e cWorld * World = m_Player->GetWorld(); - // 1.8 protocol fix - if ((int)a_BlockFace == 255) - { - a_BlockFace = BLOCK_FACE_NONE; - } - if ( (a_BlockFace != BLOCK_FACE_NONE) && // The client is interacting with a specific block - ( - (Diff(m_Player->GetPosX(), (double)a_BlockX) > 6) || // The block is too far away - (Diff(m_Player->GetPosY(), (double)a_BlockY) > 6) || - (Diff(m_Player->GetPosZ(), (double)a_BlockZ) > 6) - ) + ((Vector3d(a_BlockX, a_BlockY, a_BlockZ) - m_Player->GetPosition()).Length() >= 5) ) { AddFaceDirection(a_BlockX, a_BlockY, a_BlockZ, a_BlockFace); diff --git a/src/Protocol/Protocol17x.cpp b/src/Protocol/Protocol17x.cpp index 0b94cb144..af1dd06a5 100644 --- a/src/Protocol/Protocol17x.cpp +++ b/src/Protocol/Protocol17x.cpp @@ -2560,7 +2560,7 @@ void cProtocol172::cPacketizer::WriteItem(const cItem & a_Item) if (a_Item.m_Enchantments.IsEmpty() && a_Item.IsBothNameAndLoreEmpty() && (a_Item.m_ItemType != E_ITEM_FIREWORK_ROCKET) && (a_Item.m_ItemType != E_ITEM_FIREWORK_STAR)) { - WriteChar(0); + WriteShort(-1); return; } diff --git a/src/Protocol/Protocol18x.cpp b/src/Protocol/Protocol18x.cpp index 1793583a2..46773a438 100644 --- a/src/Protocol/Protocol18x.cpp +++ b/src/Protocol/Protocol18x.cpp @@ -1908,6 +1908,11 @@ void cProtocol180::HandlePacketBlockPlace(cByteBuffer & a_ByteBuffer) } HANDLE_READ(a_ByteBuffer, ReadByte, Byte, Face); + if (Face == 255) + { + Face = 0; + } + cItem Item; ReadItem(a_ByteBuffer, Item); |