Record Class PieceGenerator.Context<C extends FeatureConfiguration>
java.lang.Object
java.lang.Record
net.minecraft.world.level.levelgen.structure.pieces.PieceGenerator.Context<C>
- Enclosing interface:
- PieceGenerator<C extends FeatureConfiguration>
public static record PieceGenerator.Context<C extends FeatureConfiguration>(C extends FeatureConfiguration config, ChunkGenerator chunkGenerator, StructureManager structureManager, ChunkPos chunkPos, LevelHeightAccessor heightAccessor, WorldgenRandom random, long seed)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ChunkGeneratorThe field for thechunkGeneratorrecord component.private final ChunkPosThe field for thechunkPosrecord component.private final CThe field for theconfigrecord component.private final LevelHeightAccessorThe field for theheightAccessorrecord component.private final WorldgenRandomThe field for therandomrecord component.private final longThe field for theseedrecord component.private final StructureManagerThe field for thestructureManagerrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionContext(C config, ChunkGenerator chunkGenerator, StructureManager structureManager, ChunkPos chunkPos, LevelHeightAccessor heightAccessor, WorldgenRandom random, long seed) Creates an instance of aContextrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thechunkGeneratorrecord component.chunkPos()Returns the value of thechunkPosrecord component.config()Returns the value of theconfigrecord component.final 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.random()Returns the value of therandomrecord component.longseed()Returns the value of theseedrecord component.Returns the value of thestructureManagerrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
config
The field for theconfigrecord component. -
chunkGenerator
The field for thechunkGeneratorrecord component. -
structureManager
The field for thestructureManagerrecord component. -
chunkPos
The field for thechunkPosrecord component. -
heightAccessor
The field for theheightAccessorrecord component. -
random
The field for therandomrecord component. -
seed
private final long seedThe field for theseedrecord component.
-
-
Constructor Details
-
Context
public Context(C config, ChunkGenerator chunkGenerator, StructureManager structureManager, ChunkPos chunkPos, LevelHeightAccessor heightAccessor, WorldgenRandom random, long seed) Creates an instance of aContextrecord class.- Parameters:
config- the value for theconfigrecord componentchunkGenerator- the value for thechunkGeneratorrecord componentstructureManager- the value for thestructureManagerrecord componentchunkPos- the value for thechunkPosrecord componentheightAccessor- the value for theheightAccessorrecord componentrandom- the value for therandomrecord componentseed- the value for theseedrecord component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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 '=='. -
config
Returns the value of theconfigrecord component.- Returns:
- the value of the
configrecord component
-
chunkGenerator
Returns the value of thechunkGeneratorrecord component.- Returns:
- the value of the
chunkGeneratorrecord component
-
structureManager
Returns the value of thestructureManagerrecord component.- Returns:
- the value of the
structureManagerrecord 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
-
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
-