From 01b24d73eab6b0e708063d82f01ea9bb9296550c Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Sun, 3 Mar 2013 19:05:11 +0000 Subject: Player can sit in minecarts (but not move them yet) git-svn-id: http://mc-server.googlecode.com/svn/trunk@1249 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/ClientHandle.cpp | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'source/ClientHandle.cpp') 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); -- cgit v1.2.3