diff options
Diffstat (limited to 'src/Blocks/BlockWallSign.h')
-rw-r--r-- | src/Blocks/BlockWallSign.h | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/src/Blocks/BlockWallSign.h b/src/Blocks/BlockWallSign.h index 037a7bd19..b0f4015b6 100644 --- a/src/Blocks/BlockWallSign.h +++ b/src/Blocks/BlockWallSign.h @@ -1,6 +1,8 @@ #pragma once +#include "BlockHandler.h" +#include "../Entities/Player.h" #include "Chunk.h" @@ -8,15 +10,39 @@ class cBlockWallSignHandler : - public cBlockSignPostHandler + public cBlockHandler { + typedef cBlockHandler super; public: cBlockWallSignHandler(BLOCKTYPE a_BlockType) - : cBlockSignPostHandler(a_BlockType) + : cBlockHandler(a_BlockType) { } + virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override + { + a_Pickups.push_back(cItem(E_ITEM_SIGN, 1, 0)); + } + + + virtual const char * GetStepSound(void) override + { + return "step.wood"; + } + + + virtual void OnPlacedByPlayer( + cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, cPlayer * a_Player, + int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace, + int a_CursorX, int a_CursorY, int a_CursorZ, + BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta + ) override + { + a_Player->GetClientHandle()->SendEditSign(a_BlockX, a_BlockY, a_BlockZ); + } + + 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; |