1
0
cuberite-2a/src/Items/SimplePlaceableItemHandler.h
Franklin Kong 868e28b44f
Merged trivial item handlers into cSimplePlaceableItemHandler (#4766)
- Remove unused files

Co-authored-by: aiugai <aiugai@umich.edu>
Co-authored-by: Tiger Wang <ziwei.tiger@outlook.com>
2020-06-26 21:34:22 +01:00

38 lines
674 B
C++

#pragma once
#include "ItemHandler.h"
class cSimplePlaceableItemHandler :
public cItemHandler
{
using Super = cItemHandler;
public:
cSimplePlaceableItemHandler(int a_ItemType, BLOCKTYPE a_BlockType) :
Super(a_ItemType)
{
m_BlockType = a_BlockType;
}
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;
}
protected:
BLOCKTYPE m_BlockType;
};