summaryrefslogtreecommitdiffstats
path: root/src/Blocks/BlockHandler.cpp
diff options
context:
space:
mode:
authorKingCol13 <48412633+KingCol13@users.noreply.github.com>2020-09-20 20:06:28 +0200
committerGitHub <noreply@github.com>2020-09-20 20:06:28 +0200
commitb6b7fb1a6549ba0c92c5db141af6f6f9bc1d3038 (patch)
tree709d341446623a083202a955f6e9a7105784ab5e /src/Blocks/BlockHandler.cpp
parentIBM Z (#4892) (diff)
downloadcuberite-b6b7fb1a6549ba0c92c5db141af6f6f9bc1d3038.tar
cuberite-b6b7fb1a6549ba0c92c5db141af6f6f9bc1d3038.tar.gz
cuberite-b6b7fb1a6549ba0c92c5db141af6f6f9bc1d3038.tar.bz2
cuberite-b6b7fb1a6549ba0c92c5db141af6f6f9bc1d3038.tar.lz
cuberite-b6b7fb1a6549ba0c92c5db141af6f6f9bc1d3038.tar.xz
cuberite-b6b7fb1a6549ba0c92c5db141af6f6f9bc1d3038.tar.zst
cuberite-b6b7fb1a6549ba0c92c5db141af6f6f9bc1d3038.zip
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