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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user