summaryrefslogtreecommitdiffstats
path: root/src/BlockEntities/EnderChestEntity.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/BlockEntities/EnderChestEntity.cpp')
-rw-r--r--src/BlockEntities/EnderChestEntity.cpp18
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();
+ }
}