package ru.dbotthepony.mc.otm.core

import net.minecraft.util.RandomSource
import net.minecraft.world.level.Level

interface IMatteryLevel {
	/**
	 * OTM provided [RandomSource], which has better statistical parameters
	 *
	 * Original Minecraft use LCG, which may show bad behavior when repeatedly sampled *a lot*,
	 * which is what [Level]'s random is used for. OTM provided PRNG should behave better in this scenario.
	 */
	val otmRandom: RandomSource
}

val Level.otmRandom: RandomSource get() = (this as IMatteryLevel).otmRandom
