diff options
Diffstat (limited to 'src/Blocks/BlockEnchantingTable.h')
-rw-r--r-- | src/Blocks/BlockEnchantingTable.h | 39 |
1 files changed, 18 insertions, 21 deletions
diff --git a/src/Blocks/BlockEnchantingTable.h b/src/Blocks/BlockEnchantingTable.h index ba3932e5c..17db41cc4 100644 --- a/src/Blocks/BlockEnchantingTable.h +++ b/src/Blocks/BlockEnchantingTable.h @@ -11,17 +11,14 @@ -class cBlockEnchantingTableHandler final : - public cBlockHandler +class cBlockEnchantingTableHandler final : public cBlockHandler { using Super = cBlockHandler; -public: - + public: using Super::Super; -private: - + private: virtual bool OnUse( cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, @@ -32,19 +29,22 @@ private: ) const override { AString WindowName = "Enchant"; - a_WorldInterface.DoWithBlockEntityAt(a_BlockPos, [&WindowName](cBlockEntity & a_Entity) - { - ASSERT(a_Entity.GetBlockType() == E_BLOCK_ENCHANTMENT_TABLE); - - const auto & EnchantingTable = static_cast<cEnchantingTableEntity &>(a_Entity); - const auto & CustomName = EnchantingTable.GetCustomName(); - if (!CustomName.empty()) + a_WorldInterface.DoWithBlockEntityAt( + a_BlockPos, + [&WindowName](cBlockEntity & a_Entity) { - WindowName = CustomName; - } + ASSERT(a_Entity.GetBlockType() == E_BLOCK_ENCHANTMENT_TABLE); - return false; - }); + const auto & EnchantingTable = static_cast<cEnchantingTableEntity &>(a_Entity); + const auto & CustomName = EnchantingTable.GetCustomName(); + if (!CustomName.empty()) + { + WindowName = CustomName; + } + + return false; + } + ); cWindow * Window = new cEnchantingWindow(a_BlockPos, std::move(WindowName)); a_Player.OpenWindow(*Window); @@ -53,10 +53,7 @@ private: } - virtual bool IsUseable(void) const override - { - return true; - } + virtual bool IsUseable(void) const override { return true; } virtual cItems ConvertToPickups(const NIBBLETYPE a_BlockMeta, const cItem * const a_Tool) const override |