diff options
author | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-05-29 21:56:07 +0200 |
---|---|---|
committer | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-05-29 21:56:07 +0200 |
commit | 322ba59c3a0500226e1b934c3390cffe4360ddb4 (patch) | |
tree | 0f5d1917a78bc71f03de16f31bad4b0d58a22cf5 /source/cClientHandle.cpp | |
parent | Added code for the chunks to manipulate their neighbors while ticking. Also added some basic farming support - melon and pumpkin growing code. Untested and untestable so far, will test and fix later. (diff) | |
download | cuberite-322ba59c3a0500226e1b934c3390cffe4360ddb4.tar cuberite-322ba59c3a0500226e1b934c3390cffe4360ddb4.tar.gz cuberite-322ba59c3a0500226e1b934c3390cffe4360ddb4.tar.bz2 cuberite-322ba59c3a0500226e1b934c3390cffe4360ddb4.tar.lz cuberite-322ba59c3a0500226e1b934c3390cffe4360ddb4.tar.xz cuberite-322ba59c3a0500226e1b934c3390cffe4360ddb4.tar.zst cuberite-322ba59c3a0500226e1b934c3390cffe4360ddb4.zip |
Diffstat (limited to 'source/cClientHandle.cpp')
-rw-r--r-- | source/cClientHandle.cpp | 73 |
1 files changed, 2 insertions, 71 deletions
diff --git a/source/cClientHandle.cpp b/source/cClientHandle.cpp index 9920b68f8..f5aa9024d 100644 --- a/source/cClientHandle.cpp +++ b/source/cClientHandle.cpp @@ -981,77 +981,7 @@ void cClientHandle::HandleBlockPlace(cPacket_BlockPlace * a_Packet) a_Packet->m_PosX, a_Packet->m_PosY, a_Packet->m_PosZ
);
- // Hacked in edible items go!~
- // TODO: Handle hunger
- bool bEat = false;
- bool isDoor = false;
- switch (Item.m_ItemID)
- {
- case E_ITEM_APPLE:
- //m_Player->Heal(4); // 2 hearts
- m_Player->Feed(24); // 2 food bars
- bEat = true;
- break;
- case E_ITEM_GOLDEN_APPLE:
- //m_Player->Heal(20); // 10 hearts
- m_Player->Feed(60); // 5 food
- bEat = true;
- break;
- case E_ITEM_MUSHROOM_SOUP:
- ///m_Player->Heal(10); // 5 hearts
- m_Player->Feed(48); // 4 food
- bEat = true;
- break;
- case E_ITEM_BREAD:
- //m_Player->Heal(5); // 2.5 hearts
- m_Player->Feed(30); // 2.5 food
- bEat = true;
- break;
- case E_ITEM_RAW_MEAT:
- //m_Player->Heal(3); // 1.5 hearts
- m_Player->Feed(18); // 1.5 food
- bEat = true;
- break;
- case E_ITEM_COOKED_MEAT:
- //m_Player->Heal(8); // 4 hearts
- m_Player->Feed(48); // 4 food
- bEat = true;
- break;
- case E_ITEM_RAW_FISH:
- //m_Player->Heal(2); // 1 heart
- m_Player->Feed(12); // 1 food
- bEat = true;
- break;
- case E_ITEM_COOKED_FISH:
- //m_Player->Heal(5); // 2.5 hearts
- m_Player->Feed(30); // 2.5 food
- bEat = true;
- break;
- case E_ITEM_RAW_CHICKEN:
- //m_Player->Heal(3);
- m_Player->Feed(12); // 1 food
- bEat = true;
- break;
- case E_ITEM_COOKED_CHICKEN:
- //m_Player->Heal(8);
- m_Player->Feed(36); // 3 food
- bEat = true;
- break;
- case E_ITEM_RAW_BEEF:
- //m_Player->Heal(3);
- m_Player->Feed(18); // 1.5 food
- bEat = true;
- break;
- case E_ITEM_STEAK:
- //m_Player->Heal(8);
- m_Player->Feed(48); // 4 food
- bEat = true;
- break;
- default:
- break;
- };
-
- if (bEat)
+ if (m_Player->EatItem(Item.m_ItemID))
{
m_Player->GetInventory().RemoveItem(Item);
return;
@@ -1062,6 +992,7 @@ void cClientHandle::HandleBlockPlace(cPacket_BlockPlace * a_Packet) // clicked in air
return;
}
+ bool isDoor = false;
//TODO: Wrong Blocks!
int ClickedBlock = (int)m_Player->GetWorld()->GetBlock(a_Packet->m_PosX, a_Packet->m_PosY, a_Packet->m_PosZ);
|