summaryrefslogtreecommitdiffstats
path: root/src/Blocks/BlockPiston.h
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@outlook.com>2020-09-20 15:50:52 +0200
committerGitHub <noreply@github.com>2020-09-20 15:50:52 +0200
commit68cced73afe546328cf94ed07c57deee47bfadec (patch)
tree88be88e3fd4a208b9849e526f1877caa44058ab5 /src/Blocks/BlockPiston.h
parentAdded armor and shulker box cleaning (#4875) (diff)
downloadcuberite-68cced73afe546328cf94ed07c57deee47bfadec.tar
cuberite-68cced73afe546328cf94ed07c57deee47bfadec.tar.gz
cuberite-68cced73afe546328cf94ed07c57deee47bfadec.tar.bz2
cuberite-68cced73afe546328cf94ed07c57deee47bfadec.tar.lz
cuberite-68cced73afe546328cf94ed07c57deee47bfadec.tar.xz
cuberite-68cced73afe546328cf94ed07c57deee47bfadec.tar.zst
cuberite-68cced73afe546328cf94ed07c57deee47bfadec.zip
Diffstat (limited to '')
-rw-r--r--src/Blocks/BlockPiston.h36
1 files changed, 20 insertions, 16 deletions
diff --git a/src/Blocks/BlockPiston.h b/src/Blocks/BlockPiston.h
index 8799ba3ca..f8d155196 100644
--- a/src/Blocks/BlockPiston.h
+++ b/src/Blocks/BlockPiston.h
@@ -22,13 +22,7 @@ class cBlockPistonHandler:
public:
- cBlockPistonHandler(BLOCKTYPE a_BlockType);
-
- virtual void OnBroken(
- cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface,
- Vector3i a_BlockPos,
- BLOCKTYPE a_OldBlockType, NIBBLETYPE a_OldBlockMeta
- ) override;
+ using Super::Super;
static eBlockFace MetaDataToDirection(NIBBLETYPE a_MetaData)
{
@@ -54,12 +48,6 @@ public:
static void ExtendPiston(Vector3i a_BlockPos, cWorld & a_World);
static void RetractPiston(Vector3i a_BlockPos, cWorld & a_World);
- virtual ColourID GetMapBaseColourID(NIBBLETYPE a_Meta) override
- {
- UNUSED(a_Meta);
- return 11;
- }
-
/** Returns true if the piston (with the specified meta) is extended */
static inline bool IsExtended(NIBBLETYPE a_PistonMeta) { return ((a_PistonMeta & 0x8) != 0x0); }
@@ -131,6 +119,18 @@ private:
Vector3iSet & a_BlocksPushed, const Vector3i & a_PushDir
);
+ virtual ColourID GetMapBaseColourID(NIBBLETYPE a_Meta) const override
+ {
+ UNUSED(a_Meta);
+ return 11;
+ }
+
+ virtual void OnBroken(
+ cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface,
+ Vector3i a_BlockPos,
+ BLOCKTYPE a_OldBlockType, NIBBLETYPE a_OldBlockMeta
+ ) const override;
+
/** Moves a list of blocks in a specific direction */
static void PushBlocks(const Vector3iSet & a_BlocksToPush,
cWorld & a_World, const Vector3i & a_PushDir
@@ -147,13 +147,17 @@ class cBlockPistonHeadHandler:
using Super = cBlockHandler;
public:
- cBlockPistonHeadHandler(void);
+
+ constexpr cBlockPistonHeadHandler(void) :
+ Super(E_BLOCK_PISTON_EXTENSION)
+ {
+ }
virtual void OnBroken(
cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface,
Vector3i a_BlockPos,
BLOCKTYPE a_OldBlockType, NIBBLETYPE a_OldBlockMeta
- ) override;
+ ) const override;
- virtual cItems ConvertToPickups(NIBBLETYPE a_BlockMeta, cBlockEntity * a_BlockEntity, const cEntity * a_Digger, const cItem * a_Tool) override;
+ virtual cItems ConvertToPickups(NIBBLETYPE a_BlockMeta, cBlockEntity * a_BlockEntity, const cEntity * a_Digger, const cItem * a_Tool) const override;
} ;