Class ChunkRandom
- All Implemented Interfaces:
Serializable,WorldGenRandom
- See Also:
- Serialized Form
- Mappings:
Namespace Name official cqmintermediary net/minecraft/class_2919named net/minecraft/world/gen/ChunkRandom
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintstatic RandomgetSlimeRandom(int chunkX, int chunkZ, long worldSeed, long scrambler)intnext(int count)longsetCarverSeed(long worldSeed, int chunkX, int chunkZ)Seeds the randomizer to generate larger features such as caves, ravines, mineshafts and strongholds.longsetDecoratorSeed(long populationSeed, int index, int step)Seeds the randomizer to generate a given feature.longsetGrimstoneSeed(long worldSeed, int x, int y, int z)longsetPopulationSeed(long worldSeed, int blockX, int blockZ)Seeds the randomizer to create population features such as decorators and animals.longsetRegionSeed(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.longsetTerrainSeed(int chunkX, int chunkZ)Seeds the randomizer to generate the surface terrain blocks (such as grass, sand, etc.) and the bedrock patterns.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, setSeedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.world.gen.WorldGenRandom
nextBoolean, nextDouble, nextFloat, nextGaussian, nextInt, nextInt, nextLong, setSeed, skip
-
Field Details
-
sampleCount
private int sampleCount- Mappings:
Namespace Name Mixin selector official aLcqm;a:Iintermediary field_28768Lnet/minecraft/class_2919;field_28768:Inamed sampleCountLnet/minecraft/world/gen/ChunkRandom;sampleCount:I
-
-
Constructor Details
-
ChunkRandom
public ChunkRandom() -
ChunkRandom
public ChunkRandom(long seed)- Mappings:
Namespace Name Mixin selector official <init>Lcqm;<init>(J)Vintermediary <init>Lnet/minecraft/class_2919;<init>(J)Vnamed <init>Lnet/minecraft/world/gen/ChunkRandom;<init>(J)V
-
-
Method Details
-
getSampleCount
public int getSampleCount()- Mappings:
Namespace Name Mixin selector official aLcqm;a()Iintermediary method_35335Lnet/minecraft/class_2919;method_35335()Inamed getSampleCountLnet/minecraft/world/gen/ChunkRandom;getSampleCount()I
-
next
public int next(int count) -
setTerrainSeed
public long setTerrainSeed(int chunkX, int chunkZ)Seeds the randomizer to generate the surface terrain blocks (such as grass, sand, etc.) and the bedrock patterns.Note that the terrain seed does not depend on the world seed and only gets affected by chunk coordinates.
- Mappings:
Namespace Name Mixin selector official aLcqm;a(II)Jintermediary method_12659Lnet/minecraft/class_2919;method_12659(II)Jnamed setTerrainSeedLnet/minecraft/world/gen/ChunkRandom;setTerrainSeed(II)J
-
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 aLcqm;a(JII)Jintermediary method_12661Lnet/minecraft/class_2919;method_12661(JII)Jnamed setPopulationSeedLnet/minecraft/world/gen/ChunkRandom;setPopulationSeed(JII)J
-
setDecoratorSeed
public long setDecoratorSeed(long populationSeed, int index, int step)Seeds the randomizer to generate a given feature. The salt, in the form ofindex + 10000 * stepassures 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 bLcqm;b(JII)Jintermediary method_12664Lnet/minecraft/class_2919;method_12664(JII)Jnamed setDecoratorSeedLnet/minecraft/world/gen/ChunkRandom;setDecoratorSeed(JII)J
-
setCarverSeed
public long 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 cLcqm;c(JII)Jintermediary method_12663Lnet/minecraft/class_2919;method_12663(JII)Jnamed setCarverSeedLnet/minecraft/world/gen/ChunkRandom;setCarverSeed(JII)J
-
setGrimstoneSeed
public long setGrimstoneSeed(long worldSeed, int x, int y, int z)- Mappings:
Namespace Name Mixin selector official aLcqm;a(JIII)Jintermediary method_33850Lnet/minecraft/class_2919;method_33850(JIII)Jnamed setGrimstoneSeedLnet/minecraft/world/gen/ChunkRandom;setGrimstoneSeed(JIII)J
-
setRegionSeed
public long 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 bLcqm;b(JIII)Jintermediary method_12665Lnet/minecraft/class_2919;method_12665(JIII)Jnamed setRegionSeedLnet/minecraft/world/gen/ChunkRandom;setRegionSeed(JIII)J
-
getSlimeRandom
- Mappings:
Namespace Name Mixin selector official aLcqm;a(IIJJ)Ljava/util/Random;intermediary method_12662Lnet/minecraft/class_2919;method_12662(IIJJ)Ljava/util/Random;named getSlimeRandomLnet/minecraft/world/gen/ChunkRandom;getSlimeRandom(IIJJ)Ljava/util/Random;
-