2013-09-17 19:01:20 -04:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "BlockHandler.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-10-05 06:27:14 -04:00
|
|
|
class cBlockPlanksHandler final :
|
2020-04-21 16:19:22 -04:00
|
|
|
public cBlockHandler
|
2013-09-17 19:01:20 -04:00
|
|
|
{
|
2020-04-21 16:19:22 -04:00
|
|
|
using Super = cBlockHandler;
|
|
|
|
|
2013-09-17 19:01:20 -04:00
|
|
|
public:
|
2020-04-21 16:19:22 -04:00
|
|
|
|
2020-09-20 09:50:52 -04:00
|
|
|
using Super::Super;
|
2020-04-21 16:19:22 -04:00
|
|
|
|
2020-09-20 09:50:52 -04:00
|
|
|
private:
|
2020-04-21 16:19:22 -04:00
|
|
|
|
2013-09-17 19:01:20 -04:00
|
|
|
virtual bool GetPlacementBlockTypeMeta(
|
2020-04-21 16:19:22 -04:00
|
|
|
cChunkInterface & a_ChunkInterface,
|
|
|
|
cPlayer & a_Player,
|
|
|
|
const Vector3i a_PlacedBlockPos,
|
|
|
|
eBlockFace a_ClickedBlockFace,
|
|
|
|
const Vector3i a_CursorPos,
|
2013-09-17 19:01:20 -04:00
|
|
|
BLOCKTYPE & a_BlockType, NIBBLETYPE & a_BlockMeta
|
2020-09-20 09:50:52 -04:00
|
|
|
) const override
|
2013-09-17 19:01:20 -04:00
|
|
|
{
|
|
|
|
a_BlockType = m_BlockType;
|
2017-07-31 16:17:52 -04:00
|
|
|
a_BlockMeta = static_cast<NIBBLETYPE>(a_Player.GetEquippedItem().m_ItemDamage);
|
2013-09-17 19:01:20 -04:00
|
|
|
return true;
|
|
|
|
}
|
2015-06-30 10:50:15 -04:00
|
|
|
|
2020-04-21 16:19:22 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-09-20 09:50:52 -04:00
|
|
|
virtual ColourID GetMapBaseColourID(NIBBLETYPE a_Meta) const override
|
2015-06-30 10:50:15 -04:00
|
|
|
{
|
|
|
|
switch (a_Meta)
|
|
|
|
{
|
|
|
|
case E_META_PLANKS_BIRCH: return 2;
|
|
|
|
case E_META_PLANKS_JUNGLE: return 10;
|
|
|
|
case E_META_PLANKS_OAK: return 13;
|
|
|
|
case E_META_PLANKS_ACACIA: return 15;
|
|
|
|
case E_META_PLANKS_DARK_OAK: return 26;
|
|
|
|
case E_META_PLANKS_SPRUCE: return 34;
|
|
|
|
default:
|
|
|
|
{
|
|
|
|
ASSERT(!"Unhandled meta in planks handler!");
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2013-09-17 19:01:20 -04:00
|
|
|
} ;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|