summaryrefslogtreecommitdiffstats
path: root/src/Blocks/BlockSeaLantern.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/Blocks/BlockSeaLantern.h17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/Blocks/BlockSeaLantern.h b/src/Blocks/BlockSeaLantern.h
index 1fab10a11..2ff100d85 100644
--- a/src/Blocks/BlockSeaLantern.h
+++ b/src/Blocks/BlockSeaLantern.h
@@ -6,6 +6,7 @@
+
class cBlockSeaLanternHandler :
public cBlockHandler
{
@@ -24,13 +25,13 @@ private:
{
return cItem(E_BLOCK_SEA_LANTERN, 1, 0);
}
- else
- {
- unsigned int DropNum = GetRandomProvider().RandInt<char>(2, 3 + ToolFortuneLevel(a_Tool));
- // cap the dropnum to the max amount of 5
- DropNum = std::min<unsigned int>(DropNum, 5);
- // Reset meta to 0
- return cItem(E_ITEM_PRISMARINE_CRYSTALS, DropNum, 0);
- }
+
+ // Number of crystals to drop, capped at the max amount of 5.
+ const auto Drops = std::min(
+ static_cast<char>(5),
+ GetRandomProvider().RandInt<char>(2, 3 + ToolFortuneLevel(a_Tool))
+ );
+
+ return cItem(E_ITEM_PRISMARINE_CRYSTALS, Drops);
}
} ;