diff options
author | andrew <xdotftw@gmail.com> | 2014-01-23 13:57:04 +0100 |
---|---|---|
committer | andrew <xdotftw@gmail.com> | 2014-01-23 13:57:04 +0100 |
commit | 4ef61d8bf6d815b164a32bdab6a18744cbf0abd2 (patch) | |
tree | fc0c615aba88114ce209b99e7e8c8c5d925117bb /src/ClientHandle.cpp | |
parent | Merge pull request #566 from xdot/master (diff) | |
download | cuberite-4ef61d8bf6d815b164a32bdab6a18744cbf0abd2.tar cuberite-4ef61d8bf6d815b164a32bdab6a18744cbf0abd2.tar.gz cuberite-4ef61d8bf6d815b164a32bdab6a18744cbf0abd2.tar.bz2 cuberite-4ef61d8bf6d815b164a32bdab6a18744cbf0abd2.tar.lz cuberite-4ef61d8bf6d815b164a32bdab6a18744cbf0abd2.tar.xz cuberite-4ef61d8bf6d815b164a32bdab6a18744cbf0abd2.tar.zst cuberite-4ef61d8bf6d815b164a32bdab6a18744cbf0abd2.zip |
Diffstat (limited to '')
-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())); + } } |