1
0

More fixes.

This commit is contained in:
Howaner 2014-09-08 20:12:43 +02:00
parent e740739d04
commit 76fa3a7ccd
3 changed files with 7 additions and 12 deletions

View File

@ -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);

View File

@ -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;
}

View File

@ -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);