public class RandUtil
extends java.lang.Object
Random
.Constructor and Description |
---|
RandUtil() |
Modifier and Type | Method and Description |
---|---|
static java.util.Random |
createRandomForChunk(long worldSeed,
int chunkX,
int chunkY,
long magicNumber)
Creates a
Random instance for a specific generator, for the specified chunk, for a given world seed |
static java.util.Random |
createRandomForChunk(net.minecraft.world.World world,
int chunkX,
int chunkY,
long magicNumber)
Creates a
Random instance for a specific generator, for the specified chunk, in the specified world. |
public static java.util.Random createRandomForChunk(net.minecraft.world.World world, int chunkX, int chunkY, long magicNumber)
Random
instance for a specific generator, for the specified chunk, in the specified world.world
- The world to generate for.chunkX
- The chunk X co-ord to generate for.chunkY
- The chunk X co-ord to generate for.magicNumber
- The magic number, specific to the generator. Each different generator that calls this should
have a different number, so that different generators don't start by generating structures in the same
place. It is recommended that you generate a random number once, and place it statically in the
generator class (Perhaps by using new SecureRandom().nextLong()
).Random
instance that starts off with the same seed given the same arguments.public static java.util.Random createRandomForChunk(long worldSeed, int chunkX, int chunkY, long magicNumber)
Random
instance for a specific generator, for the specified chunk, for a given world seedworldSeed
- The seed of a world to generate for.chunkX
- The chunk X co-ord to generate for.chunkY
- The chunk X co-ord to generate for.magicNumber
- The magic number, specific to the generator. Each different generator that calls this should
have a different number, so that different generators don't start by generating structures in the same
place. It is recommended that you generate a random number once, and place it statically in the
generator class (Perhaps by using new SecureRandom().nextLong()
).Random
instance that starts off with the same seed given the same arguments.