summaryrefslogtreecommitdiffstats
path: root/src/Blocks/BlockFence.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/BlockFence.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/BlockFence.h27
1 files changed, 11 insertions, 16 deletions
diff --git a/src/Blocks/BlockFence.h b/src/Blocks/BlockFence.h
index 35a9b139a..13c4a6979 100644
--- a/src/Blocks/BlockFence.h
+++ b/src/Blocks/BlockFence.h
@@ -17,22 +17,17 @@ class cBlockFenceHandler:
public:
+ using Super::Super;
+
+private:
+
// These are the min and max coordinates (X and Z) for a straight fence.
// 0.4 and 0.6 are really just guesses, but they seem pretty good.
// (0.4 to 0.6 is a fence that's 0.2 wide, down the center of the block)
- const double MIN_COORD = 0.4;
- const double MAX_COORD = 0.6;
-
- cBlockFenceHandler(BLOCKTYPE a_BlockType):
- Super(a_BlockType)
- {
- }
-
-
-
-
+ static constexpr double MIN_COORD = 0.4;
+ static constexpr double MAX_COORD = 0.6;
- virtual cBoundingBox GetPlacementCollisionBox(BLOCKTYPE a_XM, BLOCKTYPE a_XP, BLOCKTYPE a_YM, BLOCKTYPE a_YP, BLOCKTYPE a_ZM, BLOCKTYPE a_ZP) override
+ virtual cBoundingBox GetPlacementCollisionBox(BLOCKTYPE a_XM, BLOCKTYPE a_XP, BLOCKTYPE a_YM, BLOCKTYPE a_YP, BLOCKTYPE a_ZM, BLOCKTYPE a_ZP) const override
{
bool XMSolid = cBlockInfo::IsSolid(a_XM);
bool XPSolid = cBlockInfo::IsSolid(a_XP);
@@ -94,7 +89,7 @@ public:
const Vector3i a_BlockPos,
eBlockFace a_BlockFace,
const Vector3i a_CursorPos
- ) override
+ ) const override
{
auto LeashKnot = cLeashKnot::FindKnotAtPos(*a_Player.GetWorld(), a_BlockPos);
auto KnotAlreadyExists = (LeashKnot != nullptr);
@@ -140,7 +135,7 @@ public:
cPlayer & a_Player,
const Vector3i a_BlockPos,
eBlockFace a_BlockFace
- ) override
+ ) const override
{
a_WorldInterface.SendBlockTo(a_BlockPos, a_Player);
}
@@ -149,7 +144,7 @@ public:
- virtual bool IsUseable(void) override
+ virtual bool IsUseable(void) const override
{
return true;
}
@@ -162,7 +157,7 @@ public:
cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface,
Vector3i a_BlockPos,
BLOCKTYPE a_OldBlockType, NIBBLETYPE a_OldBlockMeta
- ) override
+ ) const override
{
// Destroy any leash knot tied to the fence:
auto leashKnot = cLeashKnot::FindKnotAtPos(a_WorldInterface, a_BlockPos);