From 8eca58a1c9d3ea928b301de1ad772a46164372e1 Mon Sep 17 00:00:00 2001 From: KingCol13 <48412633+KingCol13@users.noreply.github.com> Date: Mon, 28 Sep 2020 13:41:49 +0100 Subject: Fortune Drops (#4932) + Implemented and standardized all clamped discrete random drops. + Changed cItems Add from push_back to emplace_back. Implement fortune for crops. + Enabled hoes to be enchanted with efficiency, silk touch and fortune. Made leaves, gravel and crops affected by fortune. Co-authored-by: Tiger Wang --- src/Blocks/BlockSeaLantern.h | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src/Blocks/BlockSeaLantern.h') diff --git a/src/Blocks/BlockSeaLantern.h b/src/Blocks/BlockSeaLantern.h index 9804642ca..d3adc95f4 100644 --- a/src/Blocks/BlockSeaLantern.h +++ b/src/Blocks/BlockSeaLantern.h @@ -23,15 +23,11 @@ private: // Drop self only when using silk-touch: if (ToolHasSilkTouch(a_Tool)) { - return cItem(E_BLOCK_SEA_LANTERN, 1, 0); + return cItem(E_BLOCK_SEA_LANTERN); } // Number of crystals to drop, capped at the max amount of 5. - const auto Drops = std::min( - static_cast(5), - GetRandomProvider().RandInt(2, 3 + ToolFortuneLevel(a_Tool)) - ); - - return cItem(E_ITEM_PRISMARINE_CRYSTALS, Drops); + const auto DropNum = FortuneDiscreteRandom(2, 3, ToolFortuneLevel(a_Tool), 5); + return cItem(E_ITEM_PRISMARINE_CRYSTALS, DropNum); } } ; -- cgit v1.2.3