diff options
author | lapayo94@gmail.com <lapayo94@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-07-17 14:02:03 +0200 |
---|---|---|
committer | lapayo94@gmail.com <lapayo94@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-07-17 14:02:03 +0200 |
commit | f473f13585e1bc901bfeb05cd5a9bb35489595da (patch) | |
tree | 48d9f165c1c154ae5baefe9712b990f837edfd37 /source/cClientHandle.cpp | |
parent | Fixed compilation on OS X and maybe *nix as well (diff) | |
download | cuberite-f473f13585e1bc901bfeb05cd5a9bb35489595da.tar cuberite-f473f13585e1bc901bfeb05cd5a9bb35489595da.tar.gz cuberite-f473f13585e1bc901bfeb05cd5a9bb35489595da.tar.bz2 cuberite-f473f13585e1bc901bfeb05cd5a9bb35489595da.tar.lz cuberite-f473f13585e1bc901bfeb05cd5a9bb35489595da.tar.xz cuberite-f473f13585e1bc901bfeb05cd5a9bb35489595da.tar.zst cuberite-f473f13585e1bc901bfeb05cd5a9bb35489595da.zip |
Diffstat (limited to '')
-rw-r--r-- | source/cClientHandle.cpp | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/source/cClientHandle.cpp b/source/cClientHandle.cpp index 76aaf2724..5bbf0f512 100644 --- a/source/cClientHandle.cpp +++ b/source/cClientHandle.cpp @@ -339,11 +339,7 @@ void cClientHandle::Authenticate(void) m_Player->GetInventory().SendWholeInventory(this); // Send health - cPacket_UpdateHealth Health; - Health.m_Health = (short)m_Player->GetHealth(); - Health.m_Food = m_Player->GetFood(); - Health.m_Saturation = m_Player->GetFoodSaturation(); - Send(Health); + m_Player->SendHealth(); m_Player->Initialize(World); StreamChunks(); @@ -856,14 +852,7 @@ void cClientHandle::HandleBlockDig(cPacket_BlockDig * a_Packet) void cClientHandle::HandleBlockPlace(cPacket_BlockPlace * a_Packet) { - if(a_Packet->m_PosX == -1 - && a_Packet->m_PosY == 255 - && a_Packet->m_PosZ == -1) - { - //I donīt know whats the idea behind these packets O.o - return; - } - + if (!CheckBlockInteractionsRate()) { return; @@ -960,7 +949,7 @@ void cClientHandle::HandleBlockPlace(cPacket_BlockPlace * a_Packet) cItem Item; Item.m_ItemID = Equipped.m_ItemID; Item.m_ItemCount = 1; - if (m_Player->EatItem(Item.m_ItemID)) + if (ItemHandler->EatItem(m_Player, &Item)) { ItemHandler->OnFoodEaten(World, m_Player, &Item); m_Player->GetInventory().RemoveItem(Item); |