diff options
author | Tiger Wang <ziwei.tiger@outlook.com> | 2020-12-29 23:01:38 +0100 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@outlook.com> | 2020-12-30 13:15:19 +0100 |
commit | 90ce4ed2b8ac47bd6f528815e6c21f0128e71dba (patch) | |
tree | 2a89648e6e454747d048cd1c9943fcc7b4c92436 /src/BlockEntities/CommandBlockEntity.cpp | |
parent | Avoid an std::list in StreamNextChunk (diff) | |
download | cuberite-90ce4ed2b8ac47bd6f528815e6c21f0128e71dba.tar cuberite-90ce4ed2b8ac47bd6f528815e6c21f0128e71dba.tar.gz cuberite-90ce4ed2b8ac47bd6f528815e6c21f0128e71dba.tar.bz2 cuberite-90ce4ed2b8ac47bd6f528815e6c21f0128e71dba.tar.lz cuberite-90ce4ed2b8ac47bd6f528815e6c21f0128e71dba.tar.xz cuberite-90ce4ed2b8ac47bd6f528815e6c21f0128e71dba.tar.zst cuberite-90ce4ed2b8ac47bd6f528815e6c21f0128e71dba.zip |
Diffstat (limited to '')
-rw-r--r-- | src/BlockEntities/CommandBlockEntity.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/BlockEntities/CommandBlockEntity.cpp b/src/BlockEntities/CommandBlockEntity.cpp index 6cc83ff68..c1e2cd430 100644 --- a/src/BlockEntities/CommandBlockEntity.cpp +++ b/src/BlockEntities/CommandBlockEntity.cpp @@ -169,7 +169,7 @@ void cCommandBlockEntity::Execute() } class CommandBlockOutCb : - public cCommandOutputCallback + public cLogCommandDeleteSelfOutputCallback { cCommandBlockEntity * m_CmdBlock; @@ -182,7 +182,7 @@ void cCommandBlockEntity::Execute() m_CmdBlock->SetLastOutput(cClientHandle::FormatChatPrefix(m_CmdBlock->GetWorld()->ShouldUseChatPrefixes(), "SUCCESS", cChatColor::Green, cChatColor::White) + a_Text); m_CmdBlock->GetWorld()->BroadcastBlockEntity(m_CmdBlock->GetPos()); } - } CmdBlockOutCb(this); + }; AString RealCommand = m_Command; @@ -203,7 +203,7 @@ void cCommandBlockEntity::Execute() { cServer * Server = cRoot::Get()->GetServer(); LOGD("cCommandBlockEntity: Executing command %s", m_Command.c_str()); - Server->QueueExecuteConsoleCommand(RealCommand, CmdBlockOutCb); + Server->QueueExecuteConsoleCommand(RealCommand, *new CommandBlockOutCb(this)); } else { |