summaryrefslogtreecommitdiffstats
path: root/src/Blocks/BlockWallSign.h
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2019-10-16 10:06:34 +0200
committerGitHub <noreply@github.com>2019-10-16 10:06:34 +0200
commit221cc4ec5cb6301743e947eaabed3fecedba796f (patch)
tree4e44c8bb7523e5d1d04468fc906ae24674c10abc /src/Blocks/BlockWallSign.h
parentFixed crash in hopper while pulling items from blockentity above itself (#4412) (diff)
downloadcuberite-221cc4ec5cb6301743e947eaabed3fecedba796f.tar
cuberite-221cc4ec5cb6301743e947eaabed3fecedba796f.tar.gz
cuberite-221cc4ec5cb6301743e947eaabed3fecedba796f.tar.bz2
cuberite-221cc4ec5cb6301743e947eaabed3fecedba796f.tar.lz
cuberite-221cc4ec5cb6301743e947eaabed3fecedba796f.tar.xz
cuberite-221cc4ec5cb6301743e947eaabed3fecedba796f.tar.zst
cuberite-221cc4ec5cb6301743e947eaabed3fecedba796f.zip
Diffstat (limited to '')
-rw-r--r--src/Blocks/BlockWallSign.h41
1 files changed, 31 insertions, 10 deletions
diff --git a/src/Blocks/BlockWallSign.h b/src/Blocks/BlockWallSign.h
index 37ca2afae..3759b4db6 100644
--- a/src/Blocks/BlockWallSign.h
+++ b/src/Blocks/BlockWallSign.h
@@ -8,22 +8,31 @@
-class cBlockWallSignHandler :
+class cBlockWallSignHandler:
public cBlockHandler
{
- typedef cBlockHandler super;
+ using super = cBlockHandler;
public:
- cBlockWallSignHandler(BLOCKTYPE a_BlockType) :
+
+ cBlockWallSignHandler(BLOCKTYPE a_BlockType):
super(a_BlockType)
{
}
- virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override
+
+
+
+
+ virtual cItems ConvertToPickups(NIBBLETYPE a_BlockMeta, cBlockEntity * a_BlockEntity, const cEntity * a_Digger, const cItem * a_Tool) override
{
- a_Pickups.push_back(cItem(E_ITEM_SIGN, 1, 0));
+ return cItem(E_ITEM_SIGN, 1, 0);
}
+
+
+
+
virtual bool CanBeAt(cChunkInterface & a_ChunkInterface, int a_RelX, int a_RelY, int a_RelZ, const cChunk & a_Chunk) override
{
int BlockX = (a_Chunk.GetPosX() * cChunkDef::Width) + a_RelX;
@@ -34,6 +43,10 @@ public:
return ((Type == E_BLOCK_WALLSIGN) || (Type == E_BLOCK_SIGN_POST) || cBlockInfo::IsSolid(Type));
}
+
+
+
+
static void GetBlockCoordsBehindTheSign(NIBBLETYPE a_BlockMeta, int & a_BlockX, int & a_BlockZ)
{
switch (a_BlockMeta)
@@ -46,14 +59,18 @@ public:
}
}
+
+
+
+
static NIBBLETYPE DirectionToMetaData(eBlockFace a_Direction)
{
switch (a_Direction)
{
- case BLOCK_FACE_ZM: return 0x2;
- case BLOCK_FACE_ZP: return 0x3;
- case BLOCK_FACE_XM: return 0x4;
- case BLOCK_FACE_XP: return 0x5;
+ 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:
@@ -61,9 +78,13 @@ public:
break;
}
}
- return 0x2;
+ return 0x02;
}
+
+
+
+
virtual ColourID GetMapBaseColourID(NIBBLETYPE a_Meta) override
{
UNUSED(a_Meta);