diff options
author | Mattes D <github@xoft.cz> | 2015-06-21 22:18:17 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2015-06-21 22:18:17 +0200 |
commit | d83c9f194f08016df54220ba0cc4f8751689d64f (patch) | |
tree | 53fbbb941c11e39190c094b3ebea82d66d61deb0 /src/Items/ItemBigFlower.h | |
parent | Merge pull request #2267 from cuberite/InfoDumpFix (diff) | |
parent | Refactored block placement workflow. (diff) | |
download | cuberite-d83c9f194f08016df54220ba0cc4f8751689d64f.tar cuberite-d83c9f194f08016df54220ba0cc4f8751689d64f.tar.gz cuberite-d83c9f194f08016df54220ba0cc4f8751689d64f.tar.bz2 cuberite-d83c9f194f08016df54220ba0cc4f8751689d64f.tar.lz cuberite-d83c9f194f08016df54220ba0cc4f8751689d64f.tar.xz cuberite-d83c9f194f08016df54220ba0cc4f8751689d64f.tar.zst cuberite-d83c9f194f08016df54220ba0cc4f8751689d64f.zip |
Diffstat (limited to 'src/Items/ItemBigFlower.h')
-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; } }; |