2012-10-01 14:08:15 -07:00
|
|
|
|
2012-07-15 13:36:34 -07:00
|
|
|
#pragma once
|
2012-10-01 14:08:15 -07:00
|
|
|
|
2012-09-23 15:09:57 -07:00
|
|
|
#include "BlockHandler.h"
|
|
|
|
#include "../World.h"
|
|
|
|
#include "../Player.h"
|
2012-07-15 13:36:34 -07:00
|
|
|
|
2012-10-01 14:08:15 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class cBlockSignHandler :
|
|
|
|
public cBlockHandler
|
2012-07-15 13:36:34 -07:00
|
|
|
{
|
|
|
|
public:
|
2012-10-03 01:52:11 -07:00
|
|
|
cBlockSignHandler(BLOCKTYPE a_BlockType)
|
|
|
|
: cBlockHandler(a_BlockType)
|
2012-07-15 13:36:34 -07:00
|
|
|
{
|
|
|
|
}
|
2012-10-01 14:08:15 -07:00
|
|
|
|
2012-07-15 13:36:34 -07:00
|
|
|
|
2012-10-01 14:08:15 -07:00
|
|
|
virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override
|
2012-07-15 13:36:34 -07:00
|
|
|
{
|
2012-10-01 14:08:15 -07:00
|
|
|
a_Pickups.push_back(cItem(E_ITEM_SIGN, 1, 0));
|
2012-07-15 13:36:34 -07:00
|
|
|
}
|
2012-10-01 14:08:15 -07:00
|
|
|
|
2012-07-15 13:36:34 -07:00
|
|
|
|
2012-10-01 14:08:15 -07:00
|
|
|
virtual bool DoesAllowBlockOnTop(void) override
|
2012-07-15 13:36:34 -07:00
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
2012-10-01 14:08:15 -07:00
|
|
|
|
2012-09-11 05:01:34 -07:00
|
|
|
|
2012-10-01 14:08:15 -07:00
|
|
|
virtual const char * GetStepSound(void) override
|
2012-09-11 05:01:34 -07:00
|
|
|
{
|
|
|
|
return "step.wood";
|
|
|
|
}
|
2013-06-04 12:22:14 -07:00
|
|
|
|
|
|
|
|
|
|
|
static char 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 ((char)a_Rotation) % 16;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static char DirectionToMetaData(char a_Direction)
|
|
|
|
{
|
|
|
|
switch (a_Direction)
|
|
|
|
{
|
|
|
|
case 0x2: return 0x2;
|
|
|
|
case 0x3: return 0x3;
|
|
|
|
case 0x4: return 0x4;
|
|
|
|
case 0x5: return 0x5;
|
|
|
|
default:
|
|
|
|
{
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return 0x2;
|
|
|
|
}
|
2012-10-01 14:08:15 -07:00
|
|
|
} ;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|