diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/core/util/Xoshiro256SSRandom.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/core/util/Xoshiro256SSRandom.kt index 472c89b27..8f368e7e6 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/core/util/Xoshiro256SSRandom.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/core/util/Xoshiro256SSRandom.kt @@ -17,6 +17,15 @@ class Xoshiro256SSRandom( ) : RandomGenerator, RandomSource { private val gaussian = MarsagliaPolarGaussian(this) + init { + require( + s0 != 0L || + s1 != 0L || + s2 != 0L || + s3 != 0L + ) { "Xoshiro can't operate with seed being entirely zero" } + } + constructor(seed: Long) : this(1L, 2L, 3L, 4L) { setSeed(seed) }