summaryrefslogtreecommitdiffstats
path: root/src/Blocks/BlockButton.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/BlockButton.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/BlockButton.h')
-rw-r--r--src/Blocks/BlockButton.h21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/Blocks/BlockButton.h b/src/Blocks/BlockButton.h
index f81220b36..86c7cb2c5 100644
--- a/src/Blocks/BlockButton.h
+++ b/src/Blocks/BlockButton.h
@@ -2,20 +2,27 @@
#include "BlockHandler.h"
#include "../Chunk.h"
-#include "MetaRotator.h"
+#include "Mixins.h"
class cBlockButtonHandler :
- public cMetaRotator<cBlockHandler, 0x07, 0x04, 0x01, 0x03, 0x02, true>
+ public cClearMetaOnDrop<cMetaRotator<cBlockHandler, 0x07, 0x04, 0x01, 0x03, 0x02, true>>
{
+ using super = cClearMetaOnDrop<cMetaRotator<cBlockHandler, 0x07, 0x04, 0x01, 0x03, 0x02, true>>;
+
public:
- cBlockButtonHandler(BLOCKTYPE a_BlockType)
- : cMetaRotator<cBlockHandler, 0x07, 0x04, 0x01, 0x03, 0x02, true>(a_BlockType)
+
+ cBlockButtonHandler(BLOCKTYPE a_BlockType):
+ super(a_BlockType)
{
}
+
+
+
+
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
{
Vector3i Pos(a_BlockX, a_BlockY, a_BlockZ);
@@ -53,12 +60,6 @@ public:
return true;
}
- virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override
- {
- // Reset meta to 0
- a_Pickups.push_back(cItem(m_BlockType, 1, 0));
- }
-
virtual bool IsUseable(void) override
{
return true;