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/Physics/Explodinator.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Physics/Explodinator.cpp') diff --git a/src/Physics/Explodinator.cpp b/src/Physics/Explodinator.cpp index 3bfb78611..c6f254cfc 100644 --- a/src/Physics/Explodinator.cpp +++ b/src/Physics/Explodinator.cpp @@ -111,7 +111,7 @@ namespace Explodinator a_Chunk.SetBlock(a_RelativePosition, a_NewBlock, 0); cChunkInterface Interface(a_World.GetChunkMap()); - cBlockInfo::GetHandler(a_DestroyedBlock)->OnBroken(Interface, a_World, a_AbsolutePosition, a_DestroyedBlock, DestroyedMeta); + cBlockHandler::For(a_DestroyedBlock).OnBroken(Interface, a_World, a_AbsolutePosition, a_DestroyedBlock, DestroyedMeta); } /** Sets the block at the given Position to air, updates surroundings, and spawns pickups, fire, shrapnel according to Minecraft rules. @@ -141,7 +141,7 @@ namespace Explodinator { const auto DestroyedMeta = a_Chunk.GetMeta(a_Position); a_Chunk.GetWorld()->SpawnItemPickups( - cBlockInfo::GetHandler(DestroyedBlock)->ConvertToPickups(DestroyedMeta, a_Chunk.GetBlockEntityRel(a_Position)), + cBlockHandler::For(DestroyedBlock).ConvertToPickups(DestroyedMeta, a_Chunk.GetBlockEntityRel(a_Position)), Absolute ); } -- cgit v1.2.3