diff options
author | Mattes D <github@xoft.cz> | 2014-01-23 14:06:05 +0100 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2014-01-23 14:06:05 +0100 |
commit | 0526ed327c9679919486e49f36ba4d051390a73e (patch) | |
tree | 7a75ff77e167214dd3dc63c31df4fc41ad8d6530 /src/ClientHandle.cpp | |
parent | Authenticator: Reduced logging levels. (diff) | |
parent | Command block fixes 2 (diff) | |
download | cuberite-0526ed327c9679919486e49f36ba4d051390a73e.tar cuberite-0526ed327c9679919486e49f36ba4d051390a73e.tar.gz cuberite-0526ed327c9679919486e49f36ba4d051390a73e.tar.bz2 cuberite-0526ed327c9679919486e49f36ba4d051390a73e.tar.lz cuberite-0526ed327c9679919486e49f36ba4d051390a73e.tar.xz cuberite-0526ed327c9679919486e49f36ba4d051390a73e.tar.zst cuberite-0526ed327c9679919486e49f36ba4d051390a73e.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())); + } } |