diff options
author | Tiger Wang <ziwei.tiger@outlook.com> | 2020-07-29 20:30:38 +0200 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@outlook.com> | 2020-08-04 19:15:18 +0200 |
commit | 6bdd130aab51b630918ed664c4389cf33bcb2e06 (patch) | |
tree | eed35c8716f9ea18afe8fd909c09e8595928a671 /src/Entities | |
parent | Do not GetBlock individually in simulators (diff) | |
download | cuberite-6bdd130aab51b630918ed664c4389cf33bcb2e06.tar cuberite-6bdd130aab51b630918ed664c4389cf33bcb2e06.tar.gz cuberite-6bdd130aab51b630918ed664c4389cf33bcb2e06.tar.bz2 cuberite-6bdd130aab51b630918ed664c4389cf33bcb2e06.tar.lz cuberite-6bdd130aab51b630918ed664c4389cf33bcb2e06.tar.xz cuberite-6bdd130aab51b630918ed664c4389cf33bcb2e06.tar.zst cuberite-6bdd130aab51b630918ed664c4389cf33bcb2e06.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Entities/Player.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/Entities/Player.cpp b/src/Entities/Player.cpp index 9ceded8b2..3bfcb4039 100644 --- a/src/Entities/Player.cpp +++ b/src/Entities/Player.cpp @@ -2910,22 +2910,20 @@ bool cPlayer::PlaceBlocks(const sSetBlockVector & a_Blocks) } } // for blk - a_Blocks[] - // Set the blocks: - m_World->SetBlocks(a_Blocks); - - // Notify the blockhandlers: cChunkInterface ChunkInterface(m_World->GetChunkMap()); for (auto blk: a_Blocks) { + // Set the blocks: + m_World->PlaceBlock(blk.GetAbsolutePos(), blk.m_BlockType, blk.m_BlockMeta); + + // Notify the blockhandlers: cBlockHandler * newBlock = BlockHandler(blk.m_BlockType); newBlock->OnPlacedByPlayer(ChunkInterface, *m_World, *this, blk); - } - // Call the "placed" hooks: - for (auto blk: a_Blocks) - { + // Call the "placed" hooks: pm->CallHookPlayerPlacedBlock(*this, blk); } + return true; } |