1
0
Fork 0
cuberite-2a/src/Items/ItemSapling.h

50 lines
729 B
C
Raw Normal View History

#pragma once
#include "ItemHandler.h"
2020-04-13 16:38:06 +00:00
class cItemSaplingHandler:
public cItemHandler
{
2020-04-13 16:38:06 +00:00
using Super = cItemHandler;
public:
2020-04-13 16:38:06 +00:00
cItemSaplingHandler(int a_ItemType):
Super(a_ItemType)
{
}
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
{
2020-04-13 16:38:06 +00:00
bool res = Super::GetPlacementBlockTypeMeta(
a_World, a_Player,
a_PlacedBlockPos, a_ClickedBlockFace,
a_CursorPos,
a_BlockType, a_BlockMeta
);
// Allow only the lowest 3 bits (top bit is for growth):
a_BlockMeta = a_BlockMeta & 0x07;
return res;
}
} ;