summaryrefslogtreecommitdiffstats
path: root/source/cClientHandle.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--source/cClientHandle.cpp36
1 files changed, 33 insertions, 3 deletions
diff --git a/source/cClientHandle.cpp b/source/cClientHandle.cpp
index 96ee3fcbd..4c4461201 100644
--- a/source/cClientHandle.cpp
+++ b/source/cClientHandle.cpp
@@ -977,6 +977,7 @@ void cClientHandle::HandleBlockPlace(cPacket_BlockPlace * a_Packet)
cDoors::ChangeDoor(m_Player->GetWorld(), a_Packet->m_PosX, a_Packet->m_PosY, a_Packet->m_PosZ);
break;
}
+
default:
{
break;
@@ -1211,12 +1212,12 @@ void cClientHandle::HandleBlockPlace(cPacket_BlockPlace * a_Packet)
}
case E_ITEM_SIGN:
{
- LOG("Sign Dir: %i", a_Packet->m_Direction);
+ LOGD("Sign Dir: %i", a_Packet->m_Direction);
if (a_Packet->m_Direction == 1)
{
- LOG("Player Rotation: %f", m_Player->GetRotation());
+ LOGD("Player Rotation: %f", m_Player->GetRotation());
MetaData = cSign::RotationToMetaData(m_Player->GetRotation());
- LOG("Sign rotation %i", MetaData);
+ LOGD("Sign rotation %i", MetaData);
a_Packet->m_ItemType = E_BLOCK_SIGN_POST;
}
else
@@ -1261,6 +1262,15 @@ void cClientHandle::HandleBlockPlace(cPacket_BlockPlace * a_Packet)
a_Packet->m_ItemType = E_BLOCK_PUMPKIN_STEM;
break;
}
+ case E_ITEM_DYE:
+ {
+ // Handle bonemeal and dyes on sheep
+ if (HandleDyes(a_Packet))
+ {
+ return;
+ }
+ break;
+ }
default:
{
break;
@@ -1557,6 +1567,26 @@ void cClientHandle::HandleKeepAlive(cPacket_KeepAlive * a_Packet)
+bool cClientHandle::HandleDyes(cPacket_BlockPlace * a_Packet)
+{
+ cItem & Equipped = m_Player->GetInventory().GetEquippedItem();
+
+ // TODO: Handle coloring the sheep, too
+
+ // Handle growing the plants:
+ if (Equipped.m_ItemHealth == E_META_DYE_WHITE)
+ {
+ cWorld * World = m_Player->GetWorld();
+ World->GrowPlant(a_Packet->m_PosX, a_Packet->m_PosY, a_Packet->m_PosZ);
+ }
+
+ return false;
+}
+
+
+
+
+
bool cClientHandle::CheckBlockInteractionsRate(void)
{
ASSERT(m_Player != NULL);