2013-09-18 17:27:21 +00:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "ItemHandler.h"
|
2020-04-08 20:35:08 +00:00
|
|
|
#include "../Blocks/BlockComparator.h"
|
2013-09-18 17:27:21 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-12-01 23:31:10 +00:00
|
|
|
class cItemComparatorHandler final:
|
2013-09-18 17:27:21 +00:00
|
|
|
public cItemHandler
|
|
|
|
{
|
2020-04-21 20:19:22 +00:00
|
|
|
using Super = cItemHandler;
|
|
|
|
|
2013-09-18 17:27:21 +00:00
|
|
|
public:
|
2020-04-21 20:19:22 +00:00
|
|
|
|
|
|
|
cItemComparatorHandler(int a_ItemType):
|
2013-09-18 17:27:21 +00:00
|
|
|
cItemHandler(a_ItemType)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2020-04-21 20:19:22 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-12-01 23:31:10 +00:00
|
|
|
virtual bool CommitPlacement(cPlayer & a_Player, const cItem & a_HeldItem, const Vector3i a_PlacePosition, const eBlockFace a_ClickedBlockFace, const Vector3i a_CursorPosition) const override
|
2013-09-18 17:27:21 +00:00
|
|
|
{
|
2021-05-05 13:25:10 +00:00
|
|
|
return a_Player.PlaceBlock(a_PlacePosition, E_BLOCK_INACTIVE_COMPARATOR, cBlockComparatorHandler::YawToMetaData(a_Player.GetYaw()));
|
2013-09-18 17:27:21 +00:00
|
|
|
}
|
|
|
|
|
2020-04-21 20:19:22 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-12-01 23:31:10 +00:00
|
|
|
virtual bool IsPlaceable(void) const override
|
2013-09-18 17:27:21 +00:00
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
} ;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|