summaryrefslogtreecommitdiffstats
path: root/src/Blocks/BlockSignPost.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/Blocks/BlockSignPost.h')
-rw-r--r--src/Blocks/BlockSignPost.h48
1 files changed, 20 insertions, 28 deletions
diff --git a/src/Blocks/BlockSignPost.h b/src/Blocks/BlockSignPost.h
index f493cb355..717a85ecf 100644
--- a/src/Blocks/BlockSignPost.h
+++ b/src/Blocks/BlockSignPost.h
@@ -15,15 +15,25 @@ class cBlockSignPostHandler:
public:
- cBlockSignPostHandler(BLOCKTYPE a_BlockType):
- Super(a_BlockType)
+ using Super::Super;
+
+ /** Converts the (player) rotation to placed-signpost block meta. */
+ static NIBBLETYPE RotationToMetaData(double a_Rotation)
{
- }
+ a_Rotation += 180 + (180 / 16); // So it's not aligned with axis
+ if (a_Rotation > 360)
+ {
+ a_Rotation -= 360;
+ }
+ a_Rotation = (a_Rotation / 360) * 16;
+ return (static_cast<char>(a_Rotation)) % 16;
+ }
+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);
}
@@ -32,7 +42,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
{
if (a_RelPos.y <= 0)
{
@@ -46,25 +56,7 @@ public:
- /** Converts the (player) rotation to placed-signpost block meta. */
- static NIBBLETYPE RotationToMetaData(double a_Rotation)
- {
- a_Rotation += 180 + (180 / 16); // So it's not aligned with axis
- if (a_Rotation > 360)
- {
- a_Rotation -= 360;
- }
-
- a_Rotation = (a_Rotation / 360) * 16;
-
- return (static_cast<char>(a_Rotation)) % 16;
- }
-
-
-
-
-
- virtual NIBBLETYPE MetaRotateCW(NIBBLETYPE a_Meta) override
+ virtual NIBBLETYPE MetaRotateCW(NIBBLETYPE a_Meta) const override
{
return (a_Meta + 4) & 0x0f;
}
@@ -73,7 +65,7 @@ public:
- virtual NIBBLETYPE MetaRotateCCW(NIBBLETYPE a_Meta) override
+ virtual NIBBLETYPE MetaRotateCCW(NIBBLETYPE a_Meta) const override
{
return (a_Meta + 12) & 0x0f;
}
@@ -82,7 +74,7 @@ public:
- virtual NIBBLETYPE MetaMirrorXY(NIBBLETYPE a_Meta) override
+ virtual NIBBLETYPE MetaMirrorXY(NIBBLETYPE a_Meta) const override
{
// Mirrors signs over the XY plane (North-South Mirroring)
@@ -95,7 +87,7 @@ public:
- virtual NIBBLETYPE MetaMirrorYZ(NIBBLETYPE a_Meta) override
+ virtual NIBBLETYPE MetaMirrorYZ(NIBBLETYPE a_Meta) const override
{
// Mirrors signs over the YZ plane (East-West Mirroring)
@@ -108,7 +100,7 @@ public:
- virtual ColourID GetMapBaseColourID(NIBBLETYPE a_Meta) override
+ virtual ColourID GetMapBaseColourID(NIBBLETYPE a_Meta) const override
{
UNUSED(a_Meta);
return 13;