summaryrefslogtreecommitdiffstats
path: root/src/Blocks/BlockGlowstone.h
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/BlockGlowstone.h
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/BlockGlowstone.h')
-rw-r--r--src/Blocks/BlockGlowstone.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/Blocks/BlockGlowstone.h b/src/Blocks/BlockGlowstone.h
index d43581a4d..930509e0a 100644
--- a/src/Blocks/BlockGlowstone.h
+++ b/src/Blocks/BlockGlowstone.h
@@ -6,7 +6,6 @@
-
class cBlockGlowstoneHandler :
public cBlockHandler
{
@@ -25,8 +24,10 @@ private:
}
else
{
- // TODO: Handle the Fortune enchantment here
- return cItem(E_ITEM_GLOWSTONE_DUST, GetRandomProvider().RandInt<char>(2, 4), 0);
+ unsigned int DropNum = GetRandomProvider().RandInt<char>(2, 4 + ToolFortuneLevel(a_Tool));
+ // cap the dropnum to the max amount of 4
+ DropNum = std::min<unsigned int>(DropNum, 4);
+ return cItem(E_ITEM_GLOWSTONE_DUST, DropNum, 0);
}
}