summaryrefslogtreecommitdiffstats
path: root/src/Blocks/BlockTrapdoor.h
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2019-10-16 10:06:34 +0200
committerGitHub <noreply@github.com>2019-10-16 10:06:34 +0200
commit221cc4ec5cb6301743e947eaabed3fecedba796f (patch)
tree4e44c8bb7523e5d1d04468fc906ae24674c10abc /src/Blocks/BlockTrapdoor.h
parentFixed crash in hopper while pulling items from blockentity above itself (#4412) (diff)
downloadcuberite-221cc4ec5cb6301743e947eaabed3fecedba796f.tar
cuberite-221cc4ec5cb6301743e947eaabed3fecedba796f.tar.gz
cuberite-221cc4ec5cb6301743e947eaabed3fecedba796f.tar.bz2
cuberite-221cc4ec5cb6301743e947eaabed3fecedba796f.tar.lz
cuberite-221cc4ec5cb6301743e947eaabed3fecedba796f.tar.xz
cuberite-221cc4ec5cb6301743e947eaabed3fecedba796f.tar.zst
cuberite-221cc4ec5cb6301743e947eaabed3fecedba796f.zip
Diffstat (limited to 'src/Blocks/BlockTrapdoor.h')
-rw-r--r--src/Blocks/BlockTrapdoor.h22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/Blocks/BlockTrapdoor.h b/src/Blocks/BlockTrapdoor.h
index 8fdae6028..e5361706c 100644
--- a/src/Blocks/BlockTrapdoor.h
+++ b/src/Blocks/BlockTrapdoor.h
@@ -2,32 +2,36 @@
#pragma once
#include "BlockHandler.h"
-#include "MetaRotator.h"
+#include "Mixins.h"
#include "../EffectID.h"
class cBlockTrapdoorHandler :
- public cMetaRotator<cBlockHandler, 0x03, 0x01, 0x02, 0x00, 0x03, false>
+ public cClearMetaOnDrop<cMetaRotator<cBlockHandler, 0x03, 0x01, 0x02, 0x00, 0x03, false>>
{
+ using super = cClearMetaOnDrop<cMetaRotator<cBlockHandler, 0x03, 0x01, 0x02, 0x00, 0x03, false>>;
+
public:
- cBlockTrapdoorHandler(BLOCKTYPE a_BlockType)
- : cMetaRotator<cBlockHandler, 0x03, 0x01, 0x02, 0x00, 0x03, false>(a_BlockType)
- {
- }
- virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override
+ cBlockTrapdoorHandler(BLOCKTYPE a_BlockType):
+ super(a_BlockType)
{
- // Reset meta to zero
- a_Pickups.push_back(cItem(m_BlockType, 1, 0));
}
+
+
+
virtual bool IsUseable(void) override
{
return true;
}
+
+
+
+
virtual bool OnUse(cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, cPlayer & a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ) override
{
if (m_BlockType == E_BLOCK_IRON_TRAPDOOR)