diff options
author | Tiger Wang <ziwei.tiger@outlook.com> | 2020-09-28 23:04:57 +0200 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@outlook.com> | 2020-09-29 00:40:19 +0200 |
commit | 429117c1f6131df407246a46bc75a724eca0da54 (patch) | |
tree | 9d5f027063fa52b981a129c4b5b402409714391c /src/Blocks/BlockDoor.h | |
parent | HandleEnchantItem: use a lambda (#4944) (diff) | |
download | cuberite-429117c1f6131df407246a46bc75a724eca0da54.tar cuberite-429117c1f6131df407246a46bc75a724eca0da54.tar.gz cuberite-429117c1f6131df407246a46bc75a724eca0da54.tar.bz2 cuberite-429117c1f6131df407246a46bc75a724eca0da54.tar.lz cuberite-429117c1f6131df407246a46bc75a724eca0da54.tar.xz cuberite-429117c1f6131df407246a46bc75a724eca0da54.tar.zst cuberite-429117c1f6131df407246a46bc75a724eca0da54.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Blocks/BlockDoor.h | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/src/Blocks/BlockDoor.h b/src/Blocks/BlockDoor.h index 36dc788aa..ee511a290 100644 --- a/src/Blocks/BlockDoor.h +++ b/src/Blocks/BlockDoor.h @@ -96,6 +96,14 @@ public: } } + /** Returns true iff the door at the specified coords is open. + The coords may point to either the top part or the bottom part of the door. */ + static bool IsOpen(cChunkInterface & a_ChunkInterface, const Vector3i a_BlockPos) + { + const auto Meta = GetCompleteDoorMeta(a_ChunkInterface, a_BlockPos); + return (Meta & 0x04) != 0; + } + /** Sets the door to the specified state. If the door is already in that state, does nothing. */ static void SetOpen(cChunkInterface & a_ChunkInterface, const Vector3i a_BlockPos, bool a_Open) { @@ -237,18 +245,6 @@ private: - /** Returns true iff the door at the specified coords is open. - The coords may point to either the top part or the bottom part of the door. */ - static NIBBLETYPE IsOpen(cChunkInterface & a_ChunkInterface, const Vector3i a_BlockPos) - { - NIBBLETYPE Meta = GetCompleteDoorMeta(a_ChunkInterface, a_BlockPos); - return ((Meta & 0x04) != 0); - } - - - - - /** Returns the complete meta composed from the both parts of the door as (TopMeta << 4) | BottomMeta The coords may point to either part of the door. The returned value has bit 3 (0x08) set iff the coords point to the top part of the door. |