summaryrefslogtreecommitdiffstats
path: root/source/ClientHandle.cpp
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-03-03 20:05:11 +0100
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-03-03 20:05:11 +0100
commit01b24d73eab6b0e708063d82f01ea9bb9296550c (patch)
tree6646ddda7a137b8960484b9fa2614683545e756a /source/ClientHandle.cpp
parentSimulators are woken up upon chunk load (diff)
downloadcuberite-01b24d73eab6b0e708063d82f01ea9bb9296550c.tar
cuberite-01b24d73eab6b0e708063d82f01ea9bb9296550c.tar.gz
cuberite-01b24d73eab6b0e708063d82f01ea9bb9296550c.tar.bz2
cuberite-01b24d73eab6b0e708063d82f01ea9bb9296550c.tar.lz
cuberite-01b24d73eab6b0e708063d82f01ea9bb9296550c.tar.xz
cuberite-01b24d73eab6b0e708063d82f01ea9bb9296550c.tar.zst
cuberite-01b24d73eab6b0e708063d82f01ea9bb9296550c.zip
Diffstat (limited to '')
-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);