diff options
author | Michal Havlíček <80639037+havel06@users.noreply.github.com> | 2023-01-25 21:46:34 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-25 21:46:34 +0100 |
commit | 7fdfb8644169a25805afd32f00ced38c1c14cec8 (patch) | |
tree | 33f107ef8a6e8c1821187294cbadd965418b6e3b /src/Blocks/BlockLever.h | |
parent | Changed Windows instructions to build out-of-source. (diff) | |
download | cuberite-7fdfb8644169a25805afd32f00ced38c1c14cec8.tar cuberite-7fdfb8644169a25805afd32f00ced38c1c14cec8.tar.gz cuberite-7fdfb8644169a25805afd32f00ced38c1c14cec8.tar.bz2 cuberite-7fdfb8644169a25805afd32f00ced38c1c14cec8.tar.lz cuberite-7fdfb8644169a25805afd32f00ced38c1c14cec8.tar.xz cuberite-7fdfb8644169a25805afd32f00ced38c1c14cec8.tar.zst cuberite-7fdfb8644169a25805afd32f00ced38c1c14cec8.zip |
Diffstat (limited to 'src/Blocks/BlockLever.h')
-rw-r--r-- | src/Blocks/BlockLever.h | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/src/Blocks/BlockLever.h b/src/Blocks/BlockLever.h index bf6f911a1..60db4ddee 100644 --- a/src/Blocks/BlockLever.h +++ b/src/Blocks/BlockLever.h @@ -2,6 +2,9 @@ #include "BlockHandler.h" #include "../Chunk.h" +#include "Blocks/BlockStairs.h" +#include "ChunkDef.h" +#include "Defines.h" #include "Mixins.h" #include "BlockSlab.h" @@ -117,7 +120,28 @@ private: (((NeighborMeta & 0x08) == 0) && (NeighborFace == BLOCK_FACE_BOTTOM)) ); } - + else if (cBlockStairsHandler::IsAnyStairType(NeighborBlockType)) + { + switch (NeighborFace) + { + case eBlockFace::BLOCK_FACE_YM: + return !(NeighborMeta & E_BLOCK_STAIRS_UPSIDE_DOWN); + case eBlockFace::BLOCK_FACE_YP: + return (NeighborMeta & E_BLOCK_STAIRS_UPSIDE_DOWN); + case eBlockFace::BLOCK_FACE_XP: + return ((NeighborMeta & 0b11) == E_BLOCK_STAIRS_XP); + case eBlockFace::BLOCK_FACE_XM: + return ((NeighborMeta & 0b11) == E_BLOCK_STAIRS_XM); + case eBlockFace::BLOCK_FACE_ZP: + return ((NeighborMeta & 0b11) == E_BLOCK_STAIRS_ZP); + case eBlockFace::BLOCK_FACE_ZM: + return ((NeighborMeta & 0b11) == E_BLOCK_STAIRS_ZM); + default: + { + return false; + } + } + } return false; } |