Better Random ======= ##### Disclaimer This mod changes RNG, and as such, affects worldgen greatly, so with this mod alone installed vanilla world seeds will no longer be reproducible. If you care about preserving vanilla worldgen parity in your mod pack, **refrain** from installing this mod. You were warned. ### About the mod Better Random, or Better PRNG if you prefer, is a mod which replace Minecraft's default [Linear congruential generator](https://en.wikipedia.org/wiki/Linear_congruential_generator) (LCG for short, used for generating most of random game events, as well as generator used when generating world features) and Xoshiro128PlusPlus (used to generate "sequences" aka random generator used for `LootPool`s) with a better random number generator, [gjrand](https://gjrand.sourceforge.net). This mod is virtually incompatible with other mods which mess with vanilla codebase random, such as Faster Random. If you have such mod installed already, decide which mod you will use. ### Features: * Replaces `RandomSupport#create`, and subsequently, `Entity#random`, `Level#random`, worldgen (but not noise map, which means world will have same elevation, but different feature placement), countless other places including mods; * Patches `WorldgenRandom` to convert `LegacyRandomSource` and `XoroshiroRandomSource` to random provided by Better Random, albeit patch is lazy and it may interfere with other mods which deliberately want these random generators to be underlying generators; * Replaces `RandomSequence` and `RandomSequences` with versions which use gjrand; * Replaces `Level#getBlockRandomPos` to use `Level#random`. Previously, `getBlockRandomPos` utilized LCG with even worse properties than one of `Level#random`. ### Caveats: * Slime chunk function was patched to be hardwired to LegacyRandomSource so they don't change with this mod installed; * This mod DOES NOT improve performance, and depending on CPU server is running on, it *may* actually reduce performance (if JIT compiler can't figure out how to vectorize used PRNG on current processor). ### Compatibility: Should be compatible with everything that doesn't go around public interfaces vanilla code provide. Existing `RandomSequence` saved data is left untouched (in meaning that nothing is done to it through code, but Minecraft continue to load/create it upon server start), and removing Better Random mid-game won't have any noticeable side effects (but world generation *may* look weird after installing/removing the mod, because `RandomSupport#create` is used to determine how to place world features, such as ores and trees).