1
0

Implement fortune for ores, glowstone and sea lanterns (#4897)

* Implemented fortune for ores, glowstone and sea lanterns (but nothing organic or flint).

* Cleanup printf

* Stopped playing golf, gave the Camels a FirstHump and moved the FortuneDropMult comment. Thanks for the review :).

* Got rid of FortuneDropMult and replaced with Peter's massive optimization/simplification.

* Fixed default lapis max droprate (8 -> 9).

* Clamp max drops for non-redstone ores to 10.

* Comment justifying the clamp.
This commit is contained in:
KingCol13
2020-09-20 19:06:28 +01:00
committed by GitHub
parent 80fa364fd7
commit b6b7fb1a65
5 changed files with 48 additions and 19 deletions

View File

@@ -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