diff options
author | Tiger Wang <ziwei.tiger@outlook.com> | 2021-01-02 14:50:34 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-02 14:50:34 +0100 |
commit | 16aeb84cd35996a6b41f10cbc48a677eeccc911c (patch) | |
tree | ae877926559d59a534bbf3c22651e6df7ffe8d71 /src/BlockEntities/EnderChestEntity.cpp | |
parent | Fix version typo in CMakeLists.txt (#5098) (diff) | |
download | cuberite-16aeb84cd35996a6b41f10cbc48a677eeccc911c.tar cuberite-16aeb84cd35996a6b41f10cbc48a677eeccc911c.tar.gz cuberite-16aeb84cd35996a6b41f10cbc48a677eeccc911c.tar.bz2 cuberite-16aeb84cd35996a6b41f10cbc48a677eeccc911c.tar.lz cuberite-16aeb84cd35996a6b41f10cbc48a677eeccc911c.tar.xz cuberite-16aeb84cd35996a6b41f10cbc48a677eeccc911c.tar.zst cuberite-16aeb84cd35996a6b41f10cbc48a677eeccc911c.zip |
Diffstat (limited to 'src/BlockEntities/EnderChestEntity.cpp')
-rw-r--r-- | src/BlockEntities/EnderChestEntity.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/BlockEntities/EnderChestEntity.cpp b/src/BlockEntities/EnderChestEntity.cpp index 44bfaf7d4..c5d490766 100644 --- a/src/BlockEntities/EnderChestEntity.cpp +++ b/src/BlockEntities/EnderChestEntity.cpp @@ -25,23 +25,23 @@ cEnderChestEntity::cEnderChestEntity(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMe -cEnderChestEntity::~cEnderChestEntity() +void cEnderChestEntity::SendTo(cClientHandle & a_Client) { - cWindow * Window = GetWindow(); - if (Window != nullptr) - { - Window->OwnerDestroyed(); - } + // Send a dummy "number of players with chest open" packet to make the chest visible: + a_Client.SendBlockAction(m_Pos.x, m_Pos.y, m_Pos.z, 1, 0, m_BlockType); } -void cEnderChestEntity::SendTo(cClientHandle & a_Client) +void cEnderChestEntity::OnRemoveFromWorld() { - // Send a dummy "number of players with chest open" packet to make the chest visible: - a_Client.SendBlockAction(m_Pos.x, m_Pos.y, m_Pos.z, 1, 0, m_BlockType); + const auto Window = GetWindow(); + if (Window != nullptr) + { + Window->OwnerDestroyed(); + } } |