summaryrefslogtreecommitdiffstats
path: root/src/Blocks/BlockHandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Blocks/BlockHandler.cpp')
-rw-r--r--src/Blocks/BlockHandler.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/Blocks/BlockHandler.cpp b/src/Blocks/BlockHandler.cpp
index 67cef6cd5..4272bc607 100644
--- a/src/Blocks/BlockHandler.cpp
+++ b/src/Blocks/BlockHandler.cpp
@@ -649,6 +649,22 @@ bool cBlockHandler::ToolHasSilkTouch(const cItem * a_Tool)
+unsigned int cBlockHandler::ToolFortuneLevel(const cItem * a_Tool)
+{
+ if (a_Tool != nullptr)
+ {
+ return a_Tool->m_Enchantments.GetLevel(cEnchantments::enchFortune);
+ }
+ else // Not a tool
+ {
+ return 0;
+ }
+}
+
+
+
+
+
const cBlockHandler & cBlockHandler::For(BLOCKTYPE a_BlockType)
{
// Switch on the block type, as an enumeration