summaryrefslogtreecommitdiffstats
path: root/source/cClientHandle.cpp
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-06-07 23:07:21 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-06-07 23:07:21 +0200
commit876014b8e8941f6de69f07e3b4cc354e9bdf3e57 (patch)
treef6fab0234d43774675f4a4d69b3c711b6aaafb33 /source/cClientHandle.cpp
parentNightbuild: bindings are automatically update before the build (diff)
downloadcuberite-876014b8e8941f6de69f07e3b4cc354e9bdf3e57.tar
cuberite-876014b8e8941f6de69f07e3b4cc354e9bdf3e57.tar.gz
cuberite-876014b8e8941f6de69f07e3b4cc354e9bdf3e57.tar.bz2
cuberite-876014b8e8941f6de69f07e3b4cc354e9bdf3e57.tar.lz
cuberite-876014b8e8941f6de69f07e3b4cc354e9bdf3e57.tar.xz
cuberite-876014b8e8941f6de69f07e3b4cc354e9bdf3e57.tar.zst
cuberite-876014b8e8941f6de69f07e3b4cc354e9bdf3e57.zip
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);