1
0

Add mixins for blocks that rotate based on player yaw at placement

Also add observer block handler.
This commit is contained in:
Alexander Harkness
2020-04-08 21:35:08 +01:00
parent 458d7f95c2
commit f40aba941e
22 changed files with 202 additions and 413 deletions

View File

@@ -10,9 +10,9 @@
class cBlockComparatorHandler :
public cMetaRotator<cBlockHandler, 0x03, 0x00, 0x01, 0x02, 0x03, true>
public cYawRotator<cBlockHandler, 0x03, 0x00, 0x01, 0x02, 0x03>
{
using super = cMetaRotator<cBlockHandler, 0x03, 0x00, 0x01, 0x02, 0x03, true>;
using super = cYawRotator<cBlockHandler, 0x03, 0x00, 0x01, 0x02, 0x03>;
public:
@@ -50,18 +50,6 @@ public:
return cItem(E_ITEM_COMPARATOR, 1, 0);
}
virtual bool GetPlacementBlockTypeMeta(
cChunkInterface & a_ChunkInterface, cPlayer & a_Player,
int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace,
int a_CursorX, int a_CursorY, int a_CursorZ,
BLOCKTYPE & a_BlockType, NIBBLETYPE & a_BlockMeta
) override
{
a_BlockType = m_BlockType;
a_BlockMeta = cBlockRedstoneRepeaterHandler::RepeaterRotationToMetaData(a_Player.GetYaw());
return true;
}
inline static bool IsInSubtractionMode(NIBBLETYPE a_Meta)
{
return ((a_Meta & 0x4) == 0x4);