Use GJRAND64 in menus
This commit is contained in:
parent
b921658eb2
commit
f9821aa552
@ -29,6 +29,7 @@ import ru.dbotthepony.mc.otm.client.screen.panels.input.QueryUserPanel
|
||||
import ru.dbotthepony.mc.otm.core.RandomSource2Generator
|
||||
import ru.dbotthepony.mc.otm.core.collect.concatIterators
|
||||
import ru.dbotthepony.mc.otm.core.collect.flatMap
|
||||
import ru.dbotthepony.mc.otm.core.util.GJRAND64RandomSource
|
||||
import java.util.*
|
||||
import java.util.concurrent.CopyOnWriteArrayList
|
||||
import java.util.function.Predicate
|
||||
@ -224,11 +225,11 @@ open class EditablePanel<out S : Screen>(
|
||||
}
|
||||
}
|
||||
|
||||
val random: RandomSource by lazy {
|
||||
val random: GJRAND64RandomSource by lazy {
|
||||
if (screen is MatteryScreen<*>) {
|
||||
screen.menu.random
|
||||
} else {
|
||||
RandomSource.create()
|
||||
GJRAND64RandomSource()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -445,8 +445,8 @@ private class AndroidResearchButton(
|
||||
}
|
||||
|
||||
private enum class PreviewScrollers(
|
||||
val init: (EditablePanel<*>, RandomSource) -> Unit,
|
||||
val scroll: (EditablePanel<*>, RandomSource) -> Boolean
|
||||
val init: (EditablePanel<*>, RandomGenerator) -> Unit,
|
||||
val scroll: (EditablePanel<*>, RandomGenerator) -> Boolean
|
||||
) {
|
||||
LEFT_TO_RIGHT(
|
||||
init = { it, random ->
|
||||
|
@ -44,6 +44,7 @@ import ru.dbotthepony.mc.otm.container.sortWithIndices
|
||||
import ru.dbotthepony.mc.otm.core.ResourceLocation
|
||||
import ru.dbotthepony.mc.otm.core.collect.ConditionalSet
|
||||
import ru.dbotthepony.mc.otm.core.math.Decimal
|
||||
import ru.dbotthepony.mc.otm.core.util.GJRAND64RandomSource
|
||||
import ru.dbotthepony.mc.otm.menu.input.BooleanInputWithFeedback
|
||||
import ru.dbotthepony.mc.otm.menu.widget.ProfiledLevelGaugeWidget
|
||||
import ru.dbotthepony.mc.otm.network.MatteryStreamCodec
|
||||
@ -81,7 +82,7 @@ abstract class MatteryMenu(
|
||||
val mSynchronizer = SynchableGroup()
|
||||
val synchronizerRemote = mSynchronizer.Remote()
|
||||
val player: Player get() = inventory.player
|
||||
val random: RandomSource = RandomSource.create()
|
||||
val random = GJRAND64RandomSource()
|
||||
|
||||
private val _playerInventorySlots = ArrayList<InventorySlot>()
|
||||
private val _playerHotbarSlots = ArrayList<InventorySlot>()
|
||||
|
Loading…
Reference in New Issue
Block a user