Class ChunkRandom
- All Implemented Interfaces:
Serializable
,java.util.random.RandomGenerator
,AbstractRandom
- See Also:
- Mappings:
Namespace Name official cts
intermediary net/minecraft/class_2919
named net/minecraft/world/gen/random/ChunkRandom
-
Nested Class Summary
Nested classes/interfaces inherited from interface java.util.random.RandomGenerator
java.util.random.RandomGenerator.ArbitrarilyJumpableGenerator, java.util.random.RandomGenerator.JumpableGenerator, java.util.random.RandomGenerator.LeapableGenerator, java.util.random.RandomGenerator.SplittableGenerator, java.util.random.RandomGenerator.StreamableGenerator
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionderive()
int
static Random
getSlimeRandom
(int chunkX, int chunkZ, long worldSeed, long scrambler) int
next
(int count) void
setCarverSeed
(long worldSeed, int chunkX, int chunkZ) Seeds the randomizer to generate larger features such as caves, ravines, mineshafts and strongholds.void
setDecoratorSeed
(long populationSeed, int index, int step) Seeds the randomizer to generate a given feature.long
setPopulationSeed
(long worldSeed, int blockX, int blockZ) Seeds the randomizer to create population features such as decorators and animals.void
setRegionSeed
(long worldSeed, int regionX, int regionZ, int salt) Seeds the randomizer to determine the start position of structure features such as temples, monuments and buried treasures within a region.void
setSeed
(long seed) Methods inherited from class java.util.Random
doubles, doubles, doubles, doubles, ints, ints, ints, ints, longs, longs, longs, longs, nextBoolean, nextBytes, nextDouble, nextFloat, nextGaussian, nextInt, nextInt, nextLong
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minecraft.world.gen.random.AbstractRandom
nextBetween, nextBoolean, nextDouble, nextFloat, nextGaussian, nextInt, nextInt, nextLong, skip
Methods inherited from interface java.util.random.RandomGenerator
isDeprecated, nextDouble, nextDouble, nextExponential, nextFloat, nextFloat, nextGaussian, nextInt, nextLong, nextLong
-
Field Details
-
baseRandom
- Mappings:
Namespace Name Mixin selector official a
Lcts;a:Lcti;
intermediary field_35141
Lnet/minecraft/class_2919;field_35141:Lnet/minecraft/class_5819;
named baseRandom
Lnet/minecraft/world/gen/random/ChunkRandom;baseRandom:Lnet/minecraft/world/gen/random/AbstractRandom;
-
sampleCount
private int sampleCount- Mappings:
Namespace Name Mixin selector official b
Lcts;b:I
intermediary field_28768
Lnet/minecraft/class_2919;field_28768:I
named sampleCount
Lnet/minecraft/world/gen/random/ChunkRandom;sampleCount:I
-
-
Constructor Details
-
ChunkRandom
- Mappings:
Namespace Name Mixin selector official <init>
Lcts;<init>(Lcti;)V
intermediary <init>
Lnet/minecraft/class_2919;<init>(Lnet/minecraft/class_5819;)V
named <init>
Lnet/minecraft/world/gen/random/ChunkRandom;<init>(Lnet/minecraft/world/gen/random/AbstractRandom;)V
-
-
Method Details
-
getSampleCount
public int getSampleCount()- Mappings:
Namespace Name Mixin selector official c
Lcts;c()I
intermediary method_35335
Lnet/minecraft/class_2919;method_35335()I
named getSampleCount
Lnet/minecraft/world/gen/random/ChunkRandom;getSampleCount()I
-
derive
- Specified by:
derive
in interfaceAbstractRandom
- Mappings:
Namespace Name Mixin selector official a
Lcti;a()Lcti;
intermediary method_38420
Lnet/minecraft/class_5819;method_38420()Lnet/minecraft/class_5819;
named derive
Lnet/minecraft/world/gen/random/AbstractRandom;derive()Lnet/minecraft/world/gen/random/AbstractRandom;
-
createRandomDeriver
- Specified by:
createRandomDeriver
in interfaceAbstractRandom
- Mappings:
Namespace Name Mixin selector official b
Lcti;b()Lcth;
intermediary method_38421
Lnet/minecraft/class_5819;method_38421()Lnet/minecraft/class_6574;
named createRandomDeriver
Lnet/minecraft/world/gen/random/AbstractRandom;createRandomDeriver()Lnet/minecraft/world/gen/random/RandomDeriver;
-
next
public int next(int count) -
setSeed
public void setSeed(long seed) - Specified by:
setSeed
in interfaceAbstractRandom
- Overrides:
setSeed
in classRandom
- Mappings:
Namespace Name Mixin selector official setSeed
Lcti;setSeed(J)V
intermediary setSeed
Lnet/minecraft/class_5819;setSeed(J)V
named setSeed
Lnet/minecraft/world/gen/random/AbstractRandom;setSeed(J)V
-
setPopulationSeed
public long setPopulationSeed(long worldSeed, int blockX, int blockZ) Seeds the randomizer to create population features such as decorators and animals.This method takes in the world seed and the negative-most block coordinates of the chunk. The coordinate pair provided is equivalent to (chunkX * 16, chunkZ * 16). The three values are mixed together through some layers of hashing to produce the population seed.
This function has been proved to be reversible through some exploitation of the underlying nextLong() weaknesses. It is also important to remember that since setSeed() truncates the 16 upper bits of world seed, only the 48 lowest bits affect the population seed output.
- Mappings:
Namespace Name Mixin selector official a
Lcts;a(JII)J
intermediary method_12661
Lnet/minecraft/class_2919;method_12661(JII)J
named setPopulationSeed
Lnet/minecraft/world/gen/random/ChunkRandom;setPopulationSeed(JII)J
-
setDecoratorSeed
public void setDecoratorSeed(long populationSeed, int index, int step) Seeds the randomizer to generate a given feature. The salt, in the form ofindex + 10000 * step
assures that each feature is seeded differently, making the decoration feel more random. Even though it does a good job at doing so, many entropy issues arise from the salt being so small and result in weird alignments between features that have an index close apart.- Parameters:
populationSeed
- the population seed computed insetPopulationSeed(long, int, int)
index
- the index of the feature in the feature liststep
- the generation step's ordinal for this feature- Mappings:
Namespace Name Mixin selector official b
Lcts;b(JII)V
intermediary method_12664
Lnet/minecraft/class_2919;method_12664(JII)V
named setDecoratorSeed
Lnet/minecraft/world/gen/random/ChunkRandom;setDecoratorSeed(JII)V
-
setCarverSeed
public void setCarverSeed(long worldSeed, int chunkX, int chunkZ) Seeds the randomizer to generate larger features such as caves, ravines, mineshafts and strongholds. It is also used to initiate structure start behavior such as rotation.Similar to the population seed, only the 48 lowest bits of the world seed affect the output since it the upper 16 bits are truncated in the setSeed() call.
- Mappings:
Namespace Name Mixin selector official c
Lcts;c(JII)V
intermediary method_12663
Lnet/minecraft/class_2919;method_12663(JII)V
named setCarverSeed
Lnet/minecraft/world/gen/random/ChunkRandom;setCarverSeed(JII)V
-
setRegionSeed
public void setRegionSeed(long worldSeed, int regionX, int regionZ, int salt) Seeds the randomizer to determine the start position of structure features such as temples, monuments and buried treasures within a region.The region coordinates pair corresponds to the coordinates of the region the seeded chunk lies in. For example, a swamp hut region is 32 by 32 chunks meaning that all chunks that lie within that region get seeded the same way.
Similarly, the upper 16 bits of world seed also do not affect the region seed because they get truncated in the setSeed() call.
- Mappings:
Namespace Name Mixin selector official a
Lcts;a(JIII)V
intermediary method_12665
Lnet/minecraft/class_2919;method_12665(JIII)V
named setRegionSeed
Lnet/minecraft/world/gen/random/ChunkRandom;setRegionSeed(JIII)V
-
getSlimeRandom
- Mappings:
Namespace Name Mixin selector official a
Lcts;a(IIJJ)Ljava/util/Random;
intermediary method_12662
Lnet/minecraft/class_2919;method_12662(IIJJ)Ljava/util/Random;
named getSlimeRandom
Lnet/minecraft/world/gen/random/ChunkRandom;getSlimeRandom(IIJJ)Ljava/util/Random;
-