summaryrefslogtreecommitdiffstats
path: root/src/Blocks
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2014-08-12 11:10:32 +0200
committermadmaxoft <github@xoft.cz>2014-08-12 11:10:32 +0200
commit3020e8cc05a0732ee880ab16bbab66e4e9b72dd7 (patch)
treeb373615f2008cee45301ac1756d18396c161ae05 /src/Blocks
parentFixed unchecked return values. (diff)
parentMerge pull request #1316 from ChriPiv/master (diff)
downloadcuberite-3020e8cc05a0732ee880ab16bbab66e4e9b72dd7.tar
cuberite-3020e8cc05a0732ee880ab16bbab66e4e9b72dd7.tar.gz
cuberite-3020e8cc05a0732ee880ab16bbab66e4e9b72dd7.tar.bz2
cuberite-3020e8cc05a0732ee880ab16bbab66e4e9b72dd7.tar.lz
cuberite-3020e8cc05a0732ee880ab16bbab66e4e9b72dd7.tar.xz
cuberite-3020e8cc05a0732ee880ab16bbab66e4e9b72dd7.tar.zst
cuberite-3020e8cc05a0732ee880ab16bbab66e4e9b72dd7.zip
Diffstat (limited to 'src/Blocks')
-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