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/ItemDoor.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 '')
-rw-r--r-- | src/Items/ItemDoor.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/Items/ItemDoor.h b/src/Items/ItemDoor.h index ddd3d4e20..2e4767349 100644 --- a/src/Items/ItemDoor.h +++ b/src/Items/ItemDoor.h @@ -20,10 +20,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 { // Vanilla only allows door placement while clicking on the top face of the block below the door: @@ -107,10 +108,9 @@ public: } // Set the blocks: - sSetBlockVector blks; - blks.emplace_back(a_BlockX, a_BlockY, a_BlockZ, BlockType, LowerBlockMeta); - blks.emplace_back(a_BlockX, a_BlockY + 1, a_BlockZ, BlockType, UpperBlockMeta); - return a_Player.PlaceBlocks(blks); + a_BlocksToSet.emplace_back(a_BlockX, a_BlockY, a_BlockZ, BlockType, LowerBlockMeta); + a_BlocksToSet.emplace_back(a_BlockX, a_BlockY + 1, a_BlockZ, BlockType, UpperBlockMeta); + return true; } |