Record Class Structure.GenerationContext
java.lang.Object
java.lang.Record
net.minecraft.world.level.levelgen.structure.Structure.GenerationContext
- Enclosing class:
Structure
public static record Structure.GenerationContext(RegistryAccess registryAccess, ChunkGenerator chunkGenerator, BiomeSource biomeSource, Climate.Sampler climateSampler, BiomeResolver biomeResolver, RandomState randomState, StructureTemplateManager structureTemplateManager, WorldgenRandom random, long seed, ChunkPos chunkPos, LevelHeightAccessor heightAccessor, Predicate<Holder<Biome>> validBiome)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final BiomeResolverThe field for thebiomeResolverrecord component.private final BiomeSourceThe field for thebiomeSourcerecord component.private final ChunkGeneratorThe field for thechunkGeneratorrecord component.private final ChunkPosThe field for thechunkPosrecord component.private final Climate.SamplerThe field for theclimateSamplerrecord component.private final LevelHeightAccessorThe field for theheightAccessorrecord component.private final WorldgenRandomThe field for therandomrecord component.private final RandomStateThe field for therandomStaterecord component.private final RegistryAccessThe field for theregistryAccessrecord component.private final longThe field for theseedrecord component.private final StructureTemplateManagerThe field for thestructureTemplateManagerrecord component.The field for thevalidBiomerecord component. -
Constructor Summary
ConstructorsConstructorDescriptionGenerationContext(RegistryAccess registryAccess, ChunkGenerator chunkGenerator, BiomeSource biomeSource, Climate.Sampler climateSampler, BiomeResolver biomeResolver, RandomState randomState, StructureTemplateManager structureTemplateManager, WorldgenRandom random, long seed, ChunkPos chunkPos, LevelHeightAccessor heightAccessor, Predicate<Holder<Biome>> validBiome) Creates an instance of aGenerationContextrecord class.GenerationContext(RegistryAccess registryAccess, ChunkGenerator chunkGenerator, BiomeSource biomeSource, Climate.Sampler climateSampler, RandomState randomState, StructureTemplateManager structureTemplateManager, long seed, ChunkPos chunkPos, LevelHeightAccessor heightAccessor, Predicate<Holder<Biome>> validBiome) -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thebiomeResolverrecord component.Returns the value of thebiomeSourcerecord component.Returns the value of thechunkGeneratorrecord component.chunkPos()Returns the value of thechunkPosrecord component.Returns the value of theclimateSamplerrecord component.booleancouldStructureExistInColumn(int blockX, int blockZ, int minBlockY, int maxBlockY) booleancouldValidBiomeExistInTerrainColumn(int blockX, int blockZ) booleanfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theheightAccessorrecord component.booleanprivate static WorldgenRandommakeRandom(long seed, ChunkPos chunkPos) random()Returns the value of therandomrecord component.Returns the value of therandomStaterecord component.Returns the value of theregistryAccessrecord component.longseed()Returns the value of theseedrecord component.Returns the value of thestructureTemplateManagerrecord component.final StringtoString()Returns a string representation of this record class.Returns the value of thevalidBiomerecord component.
-
Field Details
-
registryAccess
The field for theregistryAccessrecord component. -
chunkGenerator
The field for thechunkGeneratorrecord component. -
biomeSource
The field for thebiomeSourcerecord component. -
climateSampler
The field for theclimateSamplerrecord component. -
biomeResolver
The field for thebiomeResolverrecord component. -
randomState
The field for therandomStaterecord component. -
structureTemplateManager
The field for thestructureTemplateManagerrecord component. -
random
The field for therandomrecord component. -
seed
private final long seedThe field for theseedrecord component. -
chunkPos
The field for thechunkPosrecord component. -
heightAccessor
The field for theheightAccessorrecord component. -
validBiome
-
-
Constructor Details
-
GenerationContext
public GenerationContext(RegistryAccess registryAccess, ChunkGenerator chunkGenerator, BiomeSource biomeSource, Climate.Sampler climateSampler, RandomState randomState, StructureTemplateManager structureTemplateManager, long seed, ChunkPos chunkPos, LevelHeightAccessor heightAccessor, Predicate<Holder<Biome>> validBiome) -
GenerationContext
public GenerationContext(RegistryAccess registryAccess, ChunkGenerator chunkGenerator, BiomeSource biomeSource, Climate.Sampler climateSampler, BiomeResolver biomeResolver, RandomState randomState, StructureTemplateManager structureTemplateManager, WorldgenRandom random, long seed, ChunkPos chunkPos, LevelHeightAccessor heightAccessor, Predicate<Holder<Biome>> validBiome) Creates an instance of aGenerationContextrecord class.- Parameters:
registryAccess- the value for theregistryAccessrecord componentchunkGenerator- the value for thechunkGeneratorrecord componentbiomeSource- the value for thebiomeSourcerecord componentclimateSampler- the value for theclimateSamplerrecord componentbiomeResolver- the value for thebiomeResolverrecord componentrandomState- the value for therandomStaterecord componentstructureTemplateManager- the value for thestructureTemplateManagerrecord componentrandom- the value for therandomrecord componentseed- the value for theseedrecord componentchunkPos- the value for thechunkPosrecord componentheightAccessor- the value for theheightAccessorrecord componentvalidBiome- the value for thevalidBiomerecord component
-
-
Method Details
-
makeRandom
-
isValidBiome
-
couldStructureExistInColumn
public boolean couldStructureExistInColumn(int blockX, int blockZ, int minBlockY, int maxBlockY) -
couldValidBiomeExistInTerrainColumn
public boolean couldValidBiomeExistInTerrainColumn(int blockX, int blockZ) -
couldValidBiomeExistOnTopOfChunkCenter
public boolean couldValidBiomeExistOnTopOfChunkCenter() -
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
registryAccess
Returns the value of theregistryAccessrecord component.- Returns:
- the value of the
registryAccessrecord component
-
chunkGenerator
Returns the value of thechunkGeneratorrecord component.- Returns:
- the value of the
chunkGeneratorrecord component
-
biomeSource
Returns the value of thebiomeSourcerecord component.- Returns:
- the value of the
biomeSourcerecord component
-
climateSampler
Returns the value of theclimateSamplerrecord component.- Returns:
- the value of the
climateSamplerrecord component
-
biomeResolver
Returns the value of thebiomeResolverrecord component.- Returns:
- the value of the
biomeResolverrecord component
-
randomState
Returns the value of therandomStaterecord component.- Returns:
- the value of the
randomStaterecord component
-
structureTemplateManager
Returns the value of thestructureTemplateManagerrecord component.- Returns:
- the value of the
structureTemplateManagerrecord component
-
random
Returns the value of therandomrecord component.- Returns:
- the value of the
randomrecord component
-
seed
public long seed()Returns the value of theseedrecord component.- Returns:
- the value of the
seedrecord component
-
chunkPos
Returns the value of thechunkPosrecord component.- Returns:
- the value of the
chunkPosrecord component
-
heightAccessor
Returns the value of theheightAccessorrecord component.- Returns:
- the value of the
heightAccessorrecord component
-
validBiome
-