SeedUtils
Cubiomes.SeedUtils
— ModuleMinecraft Seed Utilities.
Index
Cubiomes.SeedUtils.MAGIC_LCG_INCREMENTOR
Cubiomes.SeedUtils.MAGIC_LCG_MULTIPLIER
Cubiomes.SeedUtils.bytes2uint64
Cubiomes.SeedUtils.mc_step_seed
Cubiomes.SeedUtils.u64_seed
API
Cubiomes.SeedUtils.u64_seed
— Functionu64_seed(x)
Converts x
to UInt64
for use as a seed, exactly as the Minecraft Java Edition does. It can be any integer or a string.
Example
julia> u64_seed(1234)
0x00000000000004d2
julia> u64_seed("hello world")
0x000000006aefe2c4
Private API
Click to see
Cubiomes.SeedUtils.MAGIC_LCG_INCREMENTOR
— ConstantMAGIC_LCG_INCREMENTOR::UInt64
The incrementor used in the LCG algorithm. This is a constant used in the Minecraft seed generation algorithm.
See Also: MAGIC_LCG_MULTIPLIER
, mc_step_seed
, LCG wiki
Cubiomes.SeedUtils.MAGIC_LCG_MULTIPLIER
— ConstantMAGIC_LCG_MULTIPLIER::UInt64
The multiplier used in the LCG algorithm. This is a constant used in the Minecraft seed generation algorithm.
See Also: MAGIC_LCG_INCREMENTOR
, mc_step_seed
, LCG wiki
Cubiomes.SeedUtils.bytes2uint64
— Methodbytes2uint64(itr)
Converts an iterator of bytes to an iterator of UInt64.
Example
julia> bytes2uint64([0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10]) |> collect
2-element Vector{UInt64}:
0x0102030405060708
0x090a0b0c0d0e0f10
Cubiomes.SeedUtils.mc_step_seed
— Methodmc_step_seed(seed::UInt64, salt::UInt64)
Used to generate the next seed in the Minecraft seed generation algorithm, given the current seed and a salt.