From 68cced73afe546328cf94ed07c57deee47bfadec Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Sun, 20 Sep 2020 14:50:52 +0100 Subject: BlockHandler initialisation is a constant expression (#4891) * BlockHandler initialisation is a constant expression If we can't make it all namespaces, this is the next best I guess. + Tag handlers constexpr, const as needed + Inherit constructors * Privatise handler functions * More constexpr Co-authored-by: Alexander Harkness --- src/Blocks/BlockRedstoneOre.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/Blocks/BlockRedstoneOre.h') diff --git a/src/Blocks/BlockRedstoneOre.h b/src/Blocks/BlockRedstoneOre.h index 9042d7cc6..bdba531f5 100644 --- a/src/Blocks/BlockRedstoneOre.h +++ b/src/Blocks/BlockRedstoneOre.h @@ -26,7 +26,7 @@ public: const Vector3i a_BlockPos, eBlockFace a_BlockFace, const Vector3i a_CursorPos - ) override + ) const override { a_ChunkInterface.SetBlock(a_BlockPos, E_BLOCK_REDSTONE_ORE_GLOWING, 0); return false; @@ -41,7 +41,7 @@ public: cWorldInterface & a_WorldInterface, cPlayer & a_Player, const Vector3i a_BlockPos - ) override + ) const override { a_ChunkInterface.SetBlock(a_BlockPos, E_BLOCK_REDSTONE_ORE_GLOWING, 0); } @@ -50,7 +50,7 @@ public: - virtual bool IsUseable() override + virtual bool IsUseable() const override { return true; } @@ -79,7 +79,7 @@ public: cBlockPluginInterface & a_BlockPluginInterface, cChunk & a_Chunk, const Vector3i a_RelPos - ) override + ) const override { auto BlockPos = a_Chunk.RelativeToAbsolute(a_RelPos); a_ChunkInterface.SetBlock(BlockPos, E_BLOCK_REDSTONE_ORE, 0); -- cgit v1.2.3