diff options
author | KingCol13 <48412633+KingCol13@users.noreply.github.com> | 2020-09-28 14:41:49 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-28 14:41:49 +0200 |
commit | 8eca58a1c9d3ea928b301de1ad772a46164372e1 (patch) | |
tree | 9627cfb9c43ed9b332a493c474e7ebe119543b89 /src/Blocks/BlockHandler.h | |
parent | Enchanting consumes lapis, removes correct number of levels (#4934) (diff) | |
download | cuberite-8eca58a1c9d3ea928b301de1ad772a46164372e1.tar cuberite-8eca58a1c9d3ea928b301de1ad772a46164372e1.tar.gz cuberite-8eca58a1c9d3ea928b301de1ad772a46164372e1.tar.bz2 cuberite-8eca58a1c9d3ea928b301de1ad772a46164372e1.tar.lz cuberite-8eca58a1c9d3ea928b301de1ad772a46164372e1.tar.xz cuberite-8eca58a1c9d3ea928b301de1ad772a46164372e1.tar.zst cuberite-8eca58a1c9d3ea928b301de1ad772a46164372e1.zip |
Diffstat (limited to 'src/Blocks/BlockHandler.h')
-rw-r--r-- | src/Blocks/BlockHandler.h | 9 |
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); |