summaryrefslogtreecommitdiffstats
path: root/src/Items/ItemDoor.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/Items/ItemDoor.h')
-rw-r--r--src/Items/ItemDoor.h13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/Items/ItemDoor.h b/src/Items/ItemDoor.h
index ddd3d4e20..e92c567fb 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:
@@ -31,7 +32,6 @@ public:
{
return false;
}
- AddFaceDirection(a_BlockX, a_BlockY, a_BlockZ, a_BlockFace);
// Door (bottom block) can be placed in Y range of [1, 254]:
if ((a_BlockY < 1) || (a_BlockY >= cChunkDef::Height - 2))
@@ -107,10 +107,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;
}