2020-06-26 16:34:22 -04:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "ItemHandler.h"
|
|
|
|
|
2020-07-14 13:28:06 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-26 16:34:22 -04:00
|
|
|
class cSimplePlaceableItemHandler :
|
|
|
|
public cItemHandler
|
|
|
|
{
|
|
|
|
using Super = cItemHandler;
|
|
|
|
|
|
|
|
public:
|
2020-07-14 13:28:06 -04:00
|
|
|
|
2020-06-26 16:34:22 -04:00
|
|
|
cSimplePlaceableItemHandler(int a_ItemType, BLOCKTYPE a_BlockType) :
|
2020-07-14 13:28:06 -04:00
|
|
|
Super(a_ItemType),
|
|
|
|
m_BlockType(a_BlockType)
|
2020-06-26 16:34:22 -04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
virtual bool IsPlaceable(void) override
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
virtual bool GetPlacementBlockTypeMeta(
|
|
|
|
cWorld * a_World, cPlayer * a_Player, const Vector3i a_PlacedBlockPos,
|
|
|
|
eBlockFace a_ClickedBlockFace, const Vector3i a_CursorPos,
|
|
|
|
BLOCKTYPE & a_BlockType, NIBBLETYPE & a_BlockMeta) override
|
|
|
|
{
|
|
|
|
a_BlockType = m_BlockType;
|
|
|
|
a_BlockMeta = 0;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2020-07-14 13:28:06 -04:00
|
|
|
private:
|
|
|
|
|
2020-06-26 16:34:22 -04:00
|
|
|
BLOCKTYPE m_BlockType;
|
|
|
|
};
|