summaryrefslogtreecommitdiffstats
path: root/src/Items/ItemEnchantingTable.h
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@outlook.com>2021-03-28 15:40:57 +0200
committerGitHub <noreply@github.com>2021-03-28 15:40:57 +0200
commit748b121703fa28b10933f4432c09391e66179118 (patch)
tree58a39b6a75c3e9127507bf3c185a99e546147276 /src/Items/ItemEnchantingTable.h
parentFix Windows XP to 7 compatibility (#5167) (diff)
downloadcuberite-748b121703fa28b10933f4432c09391e66179118.tar
cuberite-748b121703fa28b10933f4432c09391e66179118.tar.gz
cuberite-748b121703fa28b10933f4432c09391e66179118.tar.bz2
cuberite-748b121703fa28b10933f4432c09391e66179118.tar.lz
cuberite-748b121703fa28b10933f4432c09391e66179118.tar.xz
cuberite-748b121703fa28b10933f4432c09391e66179118.tar.zst
cuberite-748b121703fa28b10933f4432c09391e66179118.zip
Diffstat (limited to 'src/Items/ItemEnchantingTable.h')
-rw-r--r--src/Items/ItemEnchantingTable.h12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/Items/ItemEnchantingTable.h b/src/Items/ItemEnchantingTable.h
index c8eb42cac..12835cb4a 100644
--- a/src/Items/ItemEnchantingTable.h
+++ b/src/Items/ItemEnchantingTable.h
@@ -46,16 +46,12 @@ private:
}
const auto PlacePos = AddFaceDirection(a_ClickedBlockPos, a_ClickedBlockFace);
- a_World.DoWithBlockEntityAt(PlacePos.x, PlacePos.y, PlacePos.z, [&a_EquippedItem](cBlockEntity & a_Entity)
+ a_World.DoWithBlockEntityAt(PlacePos, [&a_EquippedItem](cBlockEntity & a_Entity)
{
- if (a_Entity.GetBlockType() != E_BLOCK_ENCHANTMENT_TABLE)
- {
- return true;
- }
+ ASSERT(a_Entity.GetBlockType() == E_BLOCK_ENCHANTMENT_TABLE);
- auto & EnchantingTable = static_cast<cEnchantingTableEntity &>(a_Entity);
- EnchantingTable.SetCustomName(a_EquippedItem.m_CustomName);
- return true;
+ static_cast<cEnchantingTableEntity &>(a_Entity).SetCustomName(a_EquippedItem.m_CustomName);
+ return false;
});
return true;