summaryrefslogtreecommitdiffstats
path: root/src/Blocks/BlockTripwireHook.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/Blocks/BlockTripwireHook.h')
-rw-r--r--src/Blocks/BlockTripwireHook.h35
1 files changed, 26 insertions, 9 deletions
diff --git a/src/Blocks/BlockTripwireHook.h b/src/Blocks/BlockTripwireHook.h
index d544fff86..8537f99ce 100644
--- a/src/Blocks/BlockTripwireHook.h
+++ b/src/Blocks/BlockTripwireHook.h
@@ -1,21 +1,28 @@
#pragma once
#include "BlockHandler.h"
-#include "MetaRotator.h"
+#include "Mixins.h"
class cBlockTripwireHookHandler :
- public cMetaRotator<cBlockHandler, 0x03, 0x02, 0x03, 0x00, 0x01>
+ public cMetaRotator<cClearMetaOnDrop<cBlockHandler>, 0x03, 0x02, 0x03, 0x00, 0x01>
{
+ using super = cMetaRotator<cClearMetaOnDrop<cBlockHandler>, 0x03, 0x02, 0x03, 0x00, 0x01>;
+
public:
- cBlockTripwireHookHandler(BLOCKTYPE a_BlockType)
- : cMetaRotator<cBlockHandler, 0x03, 0x02, 0x03, 0x00, 0x01>(a_BlockType)
+
+ cBlockTripwireHookHandler(BLOCKTYPE a_BlockType):
+ super(a_BlockType)
{
}
+
+
+
+
virtual bool GetPlacementBlockTypeMeta(
cChunkInterface & a_ChunkInterface, cPlayer & a_Player,
int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace,
@@ -29,6 +36,10 @@ public:
return true;
}
+
+
+
+
inline static NIBBLETYPE DirectionToMetadata(eBlockFace a_Direction)
{
switch (a_Direction)
@@ -48,6 +59,10 @@ public:
UNREACHABLE("Unsupported block face");
}
+
+
+
+
inline static eBlockFace MetadataToDirection(NIBBLETYPE a_Meta)
{
switch (a_Meta & 0x03)
@@ -60,11 +75,9 @@ public:
}
}
- virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override
- {
- // Reset meta to zero
- a_Pickups.push_back(cItem(E_BLOCK_TRIPWIRE_HOOK, 1, 0));
- }
+
+
+
virtual bool CanBeAt(cChunkInterface & a_ChunkInterface, int a_RelX, int a_RelY, int a_RelZ, const cChunk & a_Chunk) override
{
@@ -78,6 +91,10 @@ public:
return ((a_RelY > 0) && cBlockInfo::FullyOccupiesVoxel(BlockIsOn));
}
+
+
+
+
virtual ColourID GetMapBaseColourID(NIBBLETYPE a_Meta) override
{
UNUSED(a_Meta);