summaryrefslogtreecommitdiffstats
path: root/source/ClientHandle.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/ClientHandle.cpp')
-rw-r--r--source/ClientHandle.cpp26
1 files changed, 25 insertions, 1 deletions
diff --git a/source/ClientHandle.cpp b/source/ClientHandle.cpp
index e2a57d79e..fde80a083 100644
--- a/source/ClientHandle.cpp
+++ b/source/ClientHandle.cpp
@@ -1048,9 +1048,24 @@ void cClientHandle::HandleUpdateSign(
void cClientHandle::HandleUseEntity(int a_TargetEntityID, bool a_IsLeftClick)
{
+ // TODO: Let plugins interfere via a hook
+
if (!a_IsLeftClick)
{
- // TODO: we don't handle right-clicking yet
+ class cRclkEntity : public cEntityCallback
+ {
+ cPlayer & m_Player;
+ virtual bool Item(cEntity * a_Entity) override
+ {
+ a_Entity->OnRightClicked(m_Player);
+ return true;
+ }
+ public:
+ cRclkEntity(cPlayer & a_Player) : m_Player(a_Player) {}
+ } Callback (*m_Player);
+
+ cWorld * World = m_Player->GetWorld();
+ World->DoWithEntityByID(a_TargetEntityID, Callback);
return;
}
@@ -1449,6 +1464,15 @@ void cClientHandle::SendEntHeadLook(const cEntity & a_Entity)
+void cClientHandle::SendAttachEntity(const cEntity & a_Entity, const cEntity * a_Vehicle)
+{
+ m_Protocol->SendAttachEntity(a_Entity, a_Vehicle);
+}
+
+
+
+
+
void cClientHandle::SendBlockAction(int a_BlockX, int a_BlockY, int a_BlockZ, char a_Byte1, char a_Byte2, BLOCKTYPE a_BlockType)
{
m_Protocol->SendBlockAction(a_BlockX, a_BlockY, a_BlockZ, a_Byte1, a_Byte2, a_BlockType);