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 99438ed72..5095ac2fe 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 @@ -6,7 +6,6 @@ import net.minecraft.util.RandomSource import net.minecraft.world.level.levelgen.MarsagliaPolarGaussian import net.minecraft.world.level.levelgen.PositionalRandomFactory import net.minecraft.world.level.levelgen.RandomSupport -import java.lang.StringBuilder import java.util.random.RandomGenerator /** @@ -22,12 +21,12 @@ class Xoshiro256SSRandom private constructor( private val gaussian = MarsagliaPolarGaussian(this) init { - require( - s0 != 0L || - s1 != 0L || - s2 != 0L || - s3 != 0L - ) { "Xoshiro can't operate with seed being entirely zero" } + if (s0 or s1 or s2 or s3 == 0L) { + s0 = 0x73CF3D83FFF44FF3L + s1 = 0x6412312B70F3CD37L + s2 = -0X6BB4C4E1327BFDCFL + s3 = -0X4BE0F5BB5F3F5240L + } } constructor(s0: Long, s1: Long, s2: Long, s3: Long) : this(s0, s1, s2, s3, null) { @@ -129,4 +128,11 @@ class Xoshiro256SSRandom private constructor( throw UnsupportedOperationException() } } + + companion object { + @JvmStatic + fun raw(s0: Long, s1: Long, s2: Long, s3: Long): Xoshiro256SSRandom { + return Xoshiro256SSRandom(s0, s1, s2, s3, null) + } + } }