MCPcopy Create free account
hub / github.com/MaxBittker/rs-sdk / setSeed

Method setSeed

server/engine/src/util/JavaRandom.ts:77–82  ·  view source on GitHub ↗
(n: number)

Source from the content-addressed store, hash-verified

75 // seed = (seed ^ 0x5DEECE66DL) & ((1L << 48) - 1)
76 //
77 setSeed(n: number) {
78 checkIsPositiveInt(n);
79 s0 = ((n) & m2_16) ^ c0;
80 s1 = ((n / p2_16) & m2_16) ^ c1;
81 s2 = ((n / p2_32) & m2_16) ^ c2;
82 }
83
84 // generate exclusive random number within bound
85 nextInt(bound?: number) {

Callers 1

constructorMethod · 0.95

Calls 1

checkIsPositiveIntFunction · 0.70

Tested by

no test coverage detected