Class TransactionalRandom
java.lang.Object
net.neoforged.neoforge.transfer.transaction.SnapshotJournal<Long>
net.neoforged.neoforge.transfer.item.TransactionalRandom
A deterministic random source whose internal state is transactional,
ensuring determinism across transactions until one is committed.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected LongReturn a new nonnull object containing the current state of this journal.doublenextDouble(TransactionContext transaction) protected voidrevertToSnapshot(Long snapshot) Roll back to a state previously created bySnapshotJournal.createSnapshot().Methods inherited from class net.neoforged.neoforge.transfer.transaction.SnapshotJournal
onRootCommit, releaseSnapshot, updateSnapshots
-
Field Details
-
seed
private long seed
-
-
Constructor Details
-
TransactionalRandom
public TransactionalRandom()
-
-
Method Details
-
createSnapshot
Description copied from class:SnapshotJournalReturn a new nonnull object containing the current state of this journal.nullmay not be returned, or an exception will be thrown!- Specified by:
createSnapshotin classSnapshotJournal<Long>
-
revertToSnapshot
Description copied from class:SnapshotJournalRoll back to a state previously created bySnapshotJournal.createSnapshot().- Specified by:
revertToSnapshotin classSnapshotJournal<Long>
-
nextDouble
-