diff options
author | madmaxoft <github@xoft.cz> | 2014-01-23 23:46:51 +0100 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2014-01-23 23:46:51 +0100 |
commit | 98976de0710e60cc9d11c85cf398b0ec565399c5 (patch) | |
tree | eaae19ce64cfc644a9b5836f6fea4c6e7f9ebd2f /src/ClientHandle.cpp | |
parent | Fixed a warning in ScoreboardSerializer. (diff) | |
parent | Merge pull request #580 from xdot/master (diff) | |
download | cuberite-98976de0710e60cc9d11c85cf398b0ec565399c5.tar cuberite-98976de0710e60cc9d11c85cf398b0ec565399c5.tar.gz cuberite-98976de0710e60cc9d11c85cf398b0ec565399c5.tar.bz2 cuberite-98976de0710e60cc9d11c85cf398b0ec565399c5.tar.lz cuberite-98976de0710e60cc9d11c85cf398b0ec565399c5.tar.xz cuberite-98976de0710e60cc9d11c85cf398b0ec565399c5.tar.zst cuberite-98976de0710e60cc9d11c85cf398b0ec565399c5.zip |
Diffstat (limited to 'src/ClientHandle.cpp')
-rw-r--r-- | src/ClientHandle.cpp | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp index 0a2d3c1be..ed04edac0 100644 --- a/src/ClientHandle.cpp +++ b/src/ClientHandle.cpp @@ -610,25 +610,18 @@ void cClientHandle::HandleCommandBlockMessage(const char* a_Data, unsigned int a } } - class cUpdateCommandBlock : - public cCommandBlockCallback - { - AString m_Command; - public: - cUpdateCommandBlock(const AString & a_Command) : m_Command(a_Command) {} - - virtual bool Item(cCommandBlockEntity * a_CommandBlock) override - { - a_CommandBlock->SetCommand(m_Command); - return false; - } - } CmdBlockCB (Command); - cWorld * World = m_Player->GetWorld(); - World->DoWithCommandBlockAt(BlockX, BlockY, BlockZ, CmdBlockCB); + if (World->AreCommandBlocksEnabled()) + { + World->SetCommandBlockCommand(BlockX, BlockY, BlockZ, Command); - SendChat(Printf("%s[INFO]%s Successfully set command block command", cChatColor::Green.c_str(), cChatColor::White.c_str())); + SendChat(Printf("%s[INFO]%s Successfully set command block command", cChatColor::Green.c_str(), cChatColor::White.c_str())); + } + else + { + SendChat(Printf("%s[INFO]%s Command blocks are not enabled on this server", cChatColor::Green.c_str(), cChatColor::White.c_str())); + } } |