1
0

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
This commit is contained in:
madmaxoft@gmail.com
2013-03-03 19:05:11 +00:00
parent 55326ee2a7
commit 01b24d73ea
21 changed files with 448 additions and 84 deletions

View File

@@ -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);