summaryrefslogtreecommitdiffstats
path: root/src/Blocks/BlockHandler.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/Blocks/BlockHandler.h')
-rw-r--r--src/Blocks/BlockHandler.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/Blocks/BlockHandler.h b/src/Blocks/BlockHandler.h
index 55dbeb5ec..cc701ca8e 100644
--- a/src/Blocks/BlockHandler.h
+++ b/src/Blocks/BlockHandler.h
@@ -227,6 +227,15 @@ public:
Can be used in ConvertToPickups() implementations. */
static unsigned char ToolFortuneLevel(const cItem * a_Tool);
+ /** Returns a random number of drops taking into account fortune.
+ Only applies to drops following clamped discrete random distribution.
+ a_DefaultMax is the maximum items from one block without fortune.
+ a_BonusMax is the amount to increase the max of randInt by, usually the fortune level (but not always)
+ a_DropCap is the maximum items from one block with fortune,
+ if unspecified set to 25 to prevent lag or crash with high level tools.
+ Similar to uniform_bonus_count at https://minecraft.gamepedia.com/Loot_table#Functions */
+ static char FortuneDiscreteRandom(char a_MinDrop, char a_DefaultMax, unsigned char a_BonusMax, char a_DropCap = 25);
+
// Gets the blockhandler for the given block type.
static const cBlockHandler & For(BLOCKTYPE a_BlockType);