From 748b121703fa28b10933f4432c09391e66179118 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Sun, 28 Mar 2021 14:40:57 +0100 Subject: Unify DoWithBlockEntity (#5168) + DoWith calls now broadcast the block entity and mark the chunk dirty + Add block entity change queue to synchronise BE updates with block updates * Fixed a few incorrect assertions about BE type - Remove manual overloads --- src/BlockEntities/CommandBlockEntity.cpp | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'src/BlockEntities/CommandBlockEntity.cpp') diff --git a/src/BlockEntities/CommandBlockEntity.cpp b/src/BlockEntities/CommandBlockEntity.cpp index c1e2cd430..34b0fd5f5 100644 --- a/src/BlockEntities/CommandBlockEntity.cpp +++ b/src/BlockEntities/CommandBlockEntity.cpp @@ -43,15 +43,6 @@ bool cCommandBlockEntity::UsedBy(cPlayer * a_Player) void cCommandBlockEntity::SetCommand(const AString & a_Cmd) { m_Command = a_Cmd; - - /* - Vanilla requires that the server send a Block Entity Update after a command has been set - Therefore, command blocks don't support on-the-fly (when window is open) updating of a command and therefore... - ...the following code can't be put in UsedBy just before the window opens - - Just documenting my experience in getting this to work :P - */ - m_World->BroadcastBlockEntity(GetPos()); } @@ -60,7 +51,6 @@ void cCommandBlockEntity::SetCommand(const AString & a_Cmd) void cCommandBlockEntity::SetLastOutput(const AString & a_LastOut) { - m_World->BroadcastBlockEntity(GetPos()); m_LastOutput = a_LastOut; } @@ -180,7 +170,6 @@ void cCommandBlockEntity::Execute() { // Overwrite field m_CmdBlock->SetLastOutput(cClientHandle::FormatChatPrefix(m_CmdBlock->GetWorld()->ShouldUseChatPrefixes(), "SUCCESS", cChatColor::Green, cChatColor::White) + a_Text); - m_CmdBlock->GetWorld()->BroadcastBlockEntity(m_CmdBlock->GetPos()); } }; -- cgit v1.2.3