summaryrefslogtreecommitdiffstats
path: root/src/Blocks/BlockVine.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/BlockVine.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/BlockVine.h33
1 files changed, 14 insertions, 19 deletions
diff --git a/src/Blocks/BlockVine.h b/src/Blocks/BlockVine.h
index 25b6efe47..b652a2498 100644
--- a/src/Blocks/BlockVine.h
+++ b/src/Blocks/BlockVine.h
@@ -13,14 +13,9 @@ class cBlockVineHandler :
public:
- cBlockVineHandler(BLOCKTYPE a_BlockType):
- Super(a_BlockType)
- {
- }
-
-
-
+ using Super::Super;
+private:
virtual bool GetPlacementBlockTypeMeta(
cChunkInterface & a_ChunkInterface,
@@ -29,7 +24,7 @@ public:
eBlockFace a_ClickedBlockFace,
const Vector3i a_CursorPos,
BLOCKTYPE & a_BlockType, NIBBLETYPE & a_BlockMeta
- ) override
+ ) const override
{
// TODO: Disallow placement where the vine doesn't attach to something properly
BLOCKTYPE BlockType = 0;
@@ -51,7 +46,7 @@ public:
- 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
{
// Only drops self when using shears, otherwise drops nothing:
if ((a_Tool == nullptr) || (a_Tool->m_ItemType != E_ITEM_SHEARS))
@@ -128,7 +123,7 @@ public:
/** Returns the meta that has the maximum allowable sides of the vine, given the surroundings */
- NIBBLETYPE GetMaxMeta(cChunk & a_Chunk, Vector3i a_RelPos)
+ static NIBBLETYPE GetMaxMeta(cChunk & a_Chunk, Vector3i a_RelPos)
{
static const struct
{
@@ -162,7 +157,7 @@ public:
- virtual void OnNeighborChanged(cChunkInterface & a_ChunkInterface, Vector3i a_BlockPos, eBlockFace a_WhichNeighbor) override
+ virtual void OnNeighborChanged(cChunkInterface & a_ChunkInterface, Vector3i a_BlockPos, eBlockFace a_WhichNeighbor) const override
{
a_ChunkInterface.DoWithChunkAt(a_BlockPos, [&](cChunk & a_Chunk)
{
@@ -203,7 +198,7 @@ public:
- virtual bool DoesIgnoreBuildCollision(cChunkInterface & a_ChunkInterface, Vector3i a_Pos, cPlayer & a_Player, NIBBLETYPE a_Meta) override
+ virtual bool DoesIgnoreBuildCollision(cChunkInterface & a_ChunkInterface, Vector3i a_Pos, cPlayer & a_Player, NIBBLETYPE a_Meta) const override
{
return true;
}
@@ -212,7 +207,7 @@ public:
- virtual bool DoesDropOnUnsuitable(void) override
+ virtual bool DoesDropOnUnsuitable(void) const override
{
return false;
}
@@ -227,7 +222,7 @@ public:
cBlockPluginInterface & a_PluginInterface,
cChunk & a_Chunk,
const Vector3i a_RelPos
- ) override
+ ) const override
{
UNUSED(a_ChunkInterface);
UNUSED(a_WorldInterface);
@@ -256,7 +251,7 @@ public:
- virtual NIBBLETYPE MetaRotateCCW(NIBBLETYPE a_Meta) override
+ virtual NIBBLETYPE MetaRotateCCW(NIBBLETYPE a_Meta) const override
{
return ((a_Meta >> 1) | (a_Meta << 3)) & 0x0f; // Rotate bits to the right
}
@@ -265,7 +260,7 @@ public:
- virtual NIBBLETYPE MetaRotateCW(NIBBLETYPE a_Meta) override
+ virtual NIBBLETYPE MetaRotateCW(NIBBLETYPE a_Meta) const override
{
return ((a_Meta << 1) | (a_Meta >> 3)) & 0x0f; // Rotate bits to the left
}
@@ -274,7 +269,7 @@ public:
- virtual NIBBLETYPE MetaMirrorXY(NIBBLETYPE a_Meta) override
+ virtual NIBBLETYPE MetaMirrorXY(NIBBLETYPE a_Meta) const override
{
// Bits 2 and 4 stay, bits 1 and 3 swap
return static_cast<NIBBLETYPE>((a_Meta & 0x0a) | ((a_Meta & 0x01) << 2) | ((a_Meta & 0x04) >> 2));
@@ -284,7 +279,7 @@ public:
- virtual NIBBLETYPE MetaMirrorYZ(NIBBLETYPE a_Meta) override
+ virtual NIBBLETYPE MetaMirrorYZ(NIBBLETYPE a_Meta) const override
{
// Bits 1 and 3 stay, bits 2 and 4 swap
return static_cast<NIBBLETYPE>((a_Meta & 0x05) | ((a_Meta & 0x02) << 2) | ((a_Meta & 0x08) >> 2));
@@ -294,7 +289,7 @@ public:
- virtual ColourID GetMapBaseColourID(NIBBLETYPE a_Meta) override
+ virtual ColourID GetMapBaseColourID(NIBBLETYPE a_Meta) const override
{
UNUSED(a_Meta);
return 7;