summaryrefslogtreecommitdiffstats
path: root/src/Blocks/BlockCrops.h
diff options
context:
space:
mode:
authorpeterbell10 <peterbell10@live.co.uk>2020-10-05 12:27:14 +0200
committerGitHub <noreply@github.com>2020-10-05 12:27:14 +0200
commita9031b6bae742b333b1b390192fa590f2ecb07ea (patch)
treeb2802c81d24d339c201a0747d66ba44e9ea8b1b0 /src/Blocks/BlockCrops.h
parentFixed current end generator (#4968) (diff)
downloadcuberite-a9031b6bae742b333b1b390192fa590f2ecb07ea.tar
cuberite-a9031b6bae742b333b1b390192fa590f2ecb07ea.tar.gz
cuberite-a9031b6bae742b333b1b390192fa590f2ecb07ea.tar.bz2
cuberite-a9031b6bae742b333b1b390192fa590f2ecb07ea.tar.lz
cuberite-a9031b6bae742b333b1b390192fa590f2ecb07ea.tar.xz
cuberite-a9031b6bae742b333b1b390192fa590f2ecb07ea.tar.zst
cuberite-a9031b6bae742b333b1b390192fa590f2ecb07ea.zip
Diffstat (limited to 'src/Blocks/BlockCrops.h')
-rw-r--r--src/Blocks/BlockCrops.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Blocks/BlockCrops.h b/src/Blocks/BlockCrops.h
index 827b26881..aab2c18cd 100644
--- a/src/Blocks/BlockCrops.h
+++ b/src/Blocks/BlockCrops.h
@@ -10,7 +10,7 @@
/** Common class that takes care of beetroots, carrots, potatoes and wheat */
template <NIBBLETYPE RipeMeta>
-class cBlockCropsHandler:
+class cBlockCropsHandler final :
public cBlockPlant<true>
{
using Super = cBlockPlant<true>;
@@ -22,10 +22,10 @@ public:
private:
/** Calculate the number of seeds to drop when the crop is broken. */
- static char CalculateSeedCount(char a_Min, char a_BaseRolls, char a_FortuneLevel)
+ static char CalculateSeedCount(char a_Min, char a_BaseRolls, unsigned char a_FortuneLevel)
{
- std::binomial_distribution Binomial(a_BaseRolls + a_FortuneLevel, 0.57);
- return a_Min + Binomial(GetRandomProvider().Engine());
+ std::binomial_distribution<> Binomial(a_BaseRolls + a_FortuneLevel, 0.57);
+ return static_cast<char>(a_Min + Binomial(GetRandomProvider().Engine()));
}