diff options
author | Tiger Wang <ziwei.tiger@outlook.com> | 2020-09-20 15:50:52 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-20 15:50:52 +0200 |
commit | 68cced73afe546328cf94ed07c57deee47bfadec (patch) | |
tree | 88be88e3fd4a208b9849e526f1877caa44058ab5 /src/Blocks/BlockWallSign.h | |
parent | Added armor and shulker box cleaning (#4875) (diff) | |
download | cuberite-68cced73afe546328cf94ed07c57deee47bfadec.tar cuberite-68cced73afe546328cf94ed07c57deee47bfadec.tar.gz cuberite-68cced73afe546328cf94ed07c57deee47bfadec.tar.bz2 cuberite-68cced73afe546328cf94ed07c57deee47bfadec.tar.lz cuberite-68cced73afe546328cf94ed07c57deee47bfadec.tar.xz cuberite-68cced73afe546328cf94ed07c57deee47bfadec.tar.zst cuberite-68cced73afe546328cf94ed07c57deee47bfadec.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Blocks/BlockWallSign.h | 53 |
1 files changed, 22 insertions, 31 deletions
diff --git a/src/Blocks/BlockWallSign.h b/src/Blocks/BlockWallSign.h index 87c0355a9..1e9ea2e1f 100644 --- a/src/Blocks/BlockWallSign.h +++ b/src/Blocks/BlockWallSign.h @@ -15,16 +15,30 @@ class cBlockWallSignHandler: public: - cBlockWallSignHandler(BLOCKTYPE a_BlockType): - Super(a_BlockType) + using Super::Super; + + /** Converts the block face of the neighbor to which the wallsign is attached to the wallsign block's meta. */ + static NIBBLETYPE BlockFaceToMetaData(eBlockFace a_NeighborBlockFace) { + switch (a_NeighborBlockFace) + { + case BLOCK_FACE_ZM: return 0x02; + case BLOCK_FACE_ZP: return 0x03; + case BLOCK_FACE_XM: return 0x04; + case BLOCK_FACE_XP: return 0x05; + case BLOCK_FACE_NONE: + case BLOCK_FACE_YP: + case BLOCK_FACE_YM: + { + break; + } + } + return 0x02; } +private: - - - - virtual cItems ConvertToPickups(NIBBLETYPE a_BlockMeta, cBlockEntity * a_BlockEntity, const cEntity * a_Digger, const cItem * a_Tool) override + virtual cItems ConvertToPickups(NIBBLETYPE a_BlockMeta, cBlockEntity * a_BlockEntity, const cEntity * a_Digger, const cItem * a_Tool) const override { return cItem(E_ITEM_SIGN, 1, 0); } @@ -33,7 +47,7 @@ public: - virtual bool CanBeAt(cChunkInterface & a_ChunkInterface, const Vector3i a_RelPos, const cChunk & a_Chunk) override + virtual bool CanBeAt(cChunkInterface & a_ChunkInterface, const Vector3i a_RelPos, const cChunk & a_Chunk) const override { auto NeighborPos = a_RelPos + GetOffsetBehindTheSign(a_Chunk.GetMeta(a_RelPos)); BLOCKTYPE NeighborType; @@ -68,30 +82,7 @@ public: - /** Converts the block face of the neighbor to which the wallsign is attached to the wallsign block's meta. */ - static NIBBLETYPE BlockFaceToMetaData(eBlockFace a_NeighborBlockFace) - { - switch (a_NeighborBlockFace) - { - case BLOCK_FACE_ZM: return 0x02; - case BLOCK_FACE_ZP: return 0x03; - case BLOCK_FACE_XM: return 0x04; - case BLOCK_FACE_XP: return 0x05; - case BLOCK_FACE_NONE: - case BLOCK_FACE_YP: - case BLOCK_FACE_YM: - { - break; - } - } - return 0x02; - } - - - - - - virtual ColourID GetMapBaseColourID(NIBBLETYPE a_Meta) override + virtual ColourID GetMapBaseColourID(NIBBLETYPE a_Meta) const override { UNUSED(a_Meta); return 13; |