diff options
author | Mattes D <github@xoft.cz> | 2015-06-21 19:49:22 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2015-06-21 19:49:22 +0200 |
commit | 3889b2cac26410650d7ec6f296e0bb19c3debb4b (patch) | |
tree | 53fbbb941c11e39190c094b3ebea82d66d61deb0 /src/Items/ItemBigFlower.h | |
parent | Merge pull request #2267 from cuberite/InfoDumpFix (diff) | |
download | cuberite-3889b2cac26410650d7ec6f296e0bb19c3debb4b.tar cuberite-3889b2cac26410650d7ec6f296e0bb19c3debb4b.tar.gz cuberite-3889b2cac26410650d7ec6f296e0bb19c3debb4b.tar.bz2 cuberite-3889b2cac26410650d7ec6f296e0bb19c3debb4b.tar.lz cuberite-3889b2cac26410650d7ec6f296e0bb19c3debb4b.tar.xz cuberite-3889b2cac26410650d7ec6f296e0bb19c3debb4b.tar.zst cuberite-3889b2cac26410650d7ec6f296e0bb19c3debb4b.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Items/ItemBigFlower.h | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/Items/ItemBigFlower.h b/src/Items/ItemBigFlower.h index 4341a1a17..a052485e4 100644 --- a/src/Items/ItemBigFlower.h +++ b/src/Items/ItemBigFlower.h @@ -27,10 +27,11 @@ public: } - virtual bool OnPlayerPlace( + virtual bool GetBlocksToPlace( cWorld & a_World, cPlayer & a_Player, const cItem & a_EquippedItem, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace, - int a_CursorX, int a_CursorY, int a_CursorZ + int a_CursorX, int a_CursorY, int a_CursorZ, + sSetBlockVector & a_BlocksToSet ) override { // Can only be placed on the floor: @@ -38,16 +39,14 @@ public: { return false; } - AddFaceDirection(a_BlockX, a_BlockY, a_BlockZ, a_BlockFace); - // Place both blocks atomically: - sSetBlockVector blks; - blks.emplace_back(a_BlockX, a_BlockY, a_BlockZ, E_BLOCK_BIG_FLOWER, a_EquippedItem.m_ItemDamage & 0x07); + AddFaceDirection(a_BlockX, a_BlockY, a_BlockZ, a_BlockFace); + a_BlocksToSet.emplace_back(a_BlockX, a_BlockY, a_BlockZ, E_BLOCK_BIG_FLOWER, a_EquippedItem.m_ItemDamage & 0x07); if (a_BlockY < cChunkDef::Height - 1) { - blks.emplace_back(a_BlockX, a_BlockY + 1, a_BlockZ, E_BLOCK_BIG_FLOWER, (a_EquippedItem.m_ItemDamage & 0x07) | 0x08); + a_BlocksToSet.emplace_back(a_BlockX, a_BlockY + 1, a_BlockZ, E_BLOCK_BIG_FLOWER, (a_EquippedItem.m_ItemDamage & 0x07) | 0x08); } - return a_Player.PlaceBlocks(blks); + return true; } }; |