summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-08-10 22:04:03 +0200
committerMattes D <github@xoft.cz>2014-08-10 22:04:03 +0200
commit0e8871374f235ab8afa99a3ffcda06736b0630ec (patch)
treea8559c4bd928323b350d9c668b6ebca079f91ed7 /src
parentMerge pull request #1305 from mc-server/Food (diff)
parentChanged comment. (diff)
downloadcuberite-0e8871374f235ab8afa99a3ffcda06736b0630ec.tar
cuberite-0e8871374f235ab8afa99a3ffcda06736b0630ec.tar.gz
cuberite-0e8871374f235ab8afa99a3ffcda06736b0630ec.tar.bz2
cuberite-0e8871374f235ab8afa99a3ffcda06736b0630ec.tar.lz
cuberite-0e8871374f235ab8afa99a3ffcda06736b0630ec.tar.xz
cuberite-0e8871374f235ab8afa99a3ffcda06736b0630ec.tar.zst
cuberite-0e8871374f235ab8afa99a3ffcda06736b0630ec.zip
Diffstat (limited to '')
-rw-r--r--src/Blocks/BlockSlab.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/Blocks/BlockSlab.h b/src/Blocks/BlockSlab.h
index 214445eda..e67f0e8b3 100644
--- a/src/Blocks/BlockSlab.h
+++ b/src/Blocks/BlockSlab.h
@@ -110,6 +110,18 @@ public:
{
return ((a_BlockType == E_BLOCK_WOODEN_SLAB) || (a_BlockType == E_BLOCK_STONE_SLAB));
}
+
+
+ virtual void OnCancelRightClick(cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, cPlayer * a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace) override
+ {
+ if ((a_BlockFace == BLOCK_FACE_NONE) || (a_Player->GetEquippedItem().m_ItemType != (short)m_BlockType))
+ {
+ return;
+ }
+
+ // Sends the slab back to the client. It's to refuse a doubleslab placement.
+ a_Player->GetWorld()->SendBlockTo(a_BlockX, a_BlockY, a_BlockZ, a_Player);
+ }
/// Converts the single-slab blocktype to its equivalent double-slab blocktype