summaryrefslogtreecommitdiffstats
path: root/src/UI/ChestWindow.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2015-06-27 00:24:51 +0200
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2015-12-18 14:17:38 +0100
commit5b62c4c3145c08b093521e42c565922fa85de4ad (patch)
treedca8cbfe86aa27af174da21f6835a8fbbe83d248 /src/UI/ChestWindow.cpp
parentMerge pull request #2770 from cuberite/RemoveChunkDataCollector (diff)
downloadcuberite-5b62c4c3145c08b093521e42c565922fa85de4ad.tar
cuberite-5b62c4c3145c08b093521e42c565922fa85de4ad.tar.gz
cuberite-5b62c4c3145c08b093521e42c565922fa85de4ad.tar.bz2
cuberite-5b62c4c3145c08b093521e42c565922fa85de4ad.tar.lz
cuberite-5b62c4c3145c08b093521e42c565922fa85de4ad.tar.xz
cuberite-5b62c4c3145c08b093521e42c565922fa85de4ad.tar.zst
cuberite-5b62c4c3145c08b093521e42c565922fa85de4ad.zip
Diffstat (limited to 'src/UI/ChestWindow.cpp')
-rw-r--r--src/UI/ChestWindow.cpp16
1 files changed, 4 insertions, 12 deletions
diff --git a/src/UI/ChestWindow.cpp b/src/UI/ChestWindow.cpp
index 44992453e..8c9f33045 100644
--- a/src/UI/ChestWindow.cpp
+++ b/src/UI/ChestWindow.cpp
@@ -74,17 +74,13 @@ cChestWindow::~cChestWindow()
bool cChestWindow::ClosedByPlayer(cPlayer & a_Player, bool a_CanRefuse)
{
- int ChunkX, ChunkZ;
-
m_PrimaryChest->SetNumberOfPlayers(m_PrimaryChest->GetNumberOfPlayers() - 1);
- cChunkDef::BlockToChunk(m_PrimaryChest->GetPosX(), m_PrimaryChest->GetPosZ(), ChunkX, ChunkZ);
- m_PrimaryChest->GetWorld()->MarkRedstoneDirty(ChunkX, ChunkZ);
+ m_PrimaryChest->GetWorld()->WakeUpSimulators(m_PrimaryChest->GetPosX(), m_PrimaryChest->GetPosY(), m_PrimaryChest->GetPosZ());
if (m_SecondaryChest != nullptr)
{
m_SecondaryChest->SetNumberOfPlayers(m_SecondaryChest->GetNumberOfPlayers() - 1);
- cChunkDef::BlockToChunk(m_SecondaryChest->GetPosX(), m_SecondaryChest->GetPosZ(), ChunkX, ChunkZ);
- m_SecondaryChest->GetWorld()->MarkRedstoneDirty(ChunkX, ChunkZ);
+ m_SecondaryChest->GetWorld()->WakeUpSimulators(m_SecondaryChest->GetPosX(), m_SecondaryChest->GetPosY(), m_SecondaryChest->GetPosZ());
}
cWindow::ClosedByPlayer(a_Player, a_CanRefuse);
@@ -97,17 +93,13 @@ bool cChestWindow::ClosedByPlayer(cPlayer & a_Player, bool a_CanRefuse)
void cChestWindow::OpenedByPlayer(cPlayer & a_Player)
{
- int ChunkX, ChunkZ;
-
m_PrimaryChest->SetNumberOfPlayers(m_PrimaryChest->GetNumberOfPlayers() + 1);
- cChunkDef::BlockToChunk(m_PrimaryChest->GetPosX(), m_PrimaryChest->GetPosZ(), ChunkX, ChunkZ);
- m_PrimaryChest->GetWorld()->MarkRedstoneDirty(ChunkX, ChunkZ);
+ m_PrimaryChest->GetWorld()->WakeUpSimulators(m_PrimaryChest->GetPosX(), m_PrimaryChest->GetPosY(), m_PrimaryChest->GetPosZ());
if (m_SecondaryChest != nullptr)
{
m_SecondaryChest->SetNumberOfPlayers(m_SecondaryChest->GetNumberOfPlayers() + 1);
- cChunkDef::BlockToChunk(m_SecondaryChest->GetPosX(), m_SecondaryChest->GetPosZ(), ChunkX, ChunkZ);
- m_SecondaryChest->GetWorld()->MarkRedstoneDirty(ChunkX, ChunkZ);
+ m_SecondaryChest->GetWorld()->WakeUpSimulators(m_SecondaryChest->GetPosX(), m_SecondaryChest->GetPosY(), m_SecondaryChest->GetPosZ());
}
cWindow::OpenedByPlayer(a_Player);