diff options
author | KingCol13 <48412633+KingCol13@users.noreply.github.com> | 2020-10-01 23:33:32 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-01 23:33:32 +0200 |
commit | 8947147c25e2640519897bfdc8807e97ee291d70 (patch) | |
tree | 63eca1e5bd8ad29ac9beba5a780d466c9bb13849 /src/Enchantments.h | |
parent | Add SetBlockMeta warning in documentation (#4943) (diff) | |
download | cuberite-8947147c25e2640519897bfdc8807e97ee291d70.tar cuberite-8947147c25e2640519897bfdc8807e97ee291d70.tar.gz cuberite-8947147c25e2640519897bfdc8807e97ee291d70.tar.bz2 cuberite-8947147c25e2640519897bfdc8807e97ee291d70.tar.lz cuberite-8947147c25e2640519897bfdc8807e97ee291d70.tar.xz cuberite-8947147c25e2640519897bfdc8807e97ee291d70.tar.zst cuberite-8947147c25e2640519897bfdc8807e97ee291d70.zip |
Diffstat (limited to 'src/Enchantments.h')
-rw-r--r-- | src/Enchantments.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/Enchantments.h b/src/Enchantments.h index 40dbee038..1f4547058 100644 --- a/src/Enchantments.h +++ b/src/Enchantments.h @@ -9,11 +9,11 @@ #pragma once #include "Defines.h" +#include "FastRandom.h" #include "WorldStorage/EnchantmentSerializer.h" - // fwd: "WorldStorage/FastNBT.h" class cFastNBTWriter; class cParsedNBT; @@ -27,6 +27,7 @@ typedef std::vector<cWeightedEnchantment> cWeightedEnchantments; + /** Class that stores item enchantments or stored-enchantments The enchantments may be serialized to a stringspec and read back from such stringspec. The format for the stringspec is "id=lvl;id=lvl;id=lvl...", with an optional semicolon at the end, @@ -139,8 +140,8 @@ public: /** Check enchantment conflicts from enchantments from the vector */ static void CheckEnchantmentConflictsFromVector(cWeightedEnchantments & a_Enchantments, const cEnchantments & a_FirstEnchantment); - /** Gets random enchantment from Vector and returns it */ - static cEnchantments GetRandomEnchantmentFromVector(const cWeightedEnchantments & a_Enchantments); + /** Gets random enchantment from Vector and returns it, with randomness derived from the provided PRNG. */ + static cEnchantments GetRandomEnchantmentFromVector(const cWeightedEnchantments & a_Enchantments, MTRand & a_Random); /** Selects one enchantment from a Vector using cNoise. Mostly used for generators. Uses the enchantments' weights for the random distribution. |