Record Class TemplateFeature
java.lang.Object
java.lang.Record
net.minecraft.world.level.levelgen.feature.TemplateFeature
- All Implemented Interfaces:
Feature
public record TemplateFeature(WeightedList<TemplateFeature.TemplateEntry> templates, Optional<Holder<StructureProcessorList>> processors)
extends Record
implements Feature
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<TemplateFeature> private final Optional<Holder<StructureProcessorList>> The field for theprocessorsrecord component.private final WeightedList<TemplateFeature.TemplateEntry> The field for thetemplatesrecord component.Fields inherited from interface Feature
DIRECT_CODEC, LIST_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionTemplateFeature(WeightedList<TemplateFeature.TemplateEntry> templates) TemplateFeature(WeightedList<TemplateFeature.TemplateEntry> templates, Optional<Holder<StructureProcessorList>> processors) Creates an instance of aTemplateFeaturerecord class. -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.MapCodec<TemplateFeature> codec()final booleanIndicates whether some other object is "equal to" this one.private Vec3igetRotatedOffset(Rotation rotation, Direction.Axis axis, StructureTemplate template) final inthashCode()Returns a hash code value for this object.booleanplace(WorldGenLevel level, ChunkGenerator chunkGenerator, RandomSource random, BlockPos origin) Returns the value of theprocessorsrecord component.static TemplateFeaturesimple(Identifier id) static TemplateFeaturesimple(Identifier id, Holder<StructureProcessorList> processors) Returns the value of thetemplatesrecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from interface Feature
getSubFeatures, markAboveForPostProcessing, safeSetBlock, setBlock
-
Field Details
-
templates
The field for thetemplatesrecord component. -
processors
The field for theprocessorsrecord component. -
CODEC
-
-
Constructor Details
-
TemplateFeature
-
TemplateFeature
public TemplateFeature(WeightedList<TemplateFeature.TemplateEntry> templates, Optional<Holder<StructureProcessorList>> processors) Creates an instance of aTemplateFeaturerecord class.- Parameters:
templates- the value for thetemplatesrecord componentprocessors- the value for theprocessorsrecord component
-
-
Method Details
-
simple
-
simple
-
codec
-
place
public boolean place(WorldGenLevel level, ChunkGenerator chunkGenerator, RandomSource random, BlockPos origin) -
getRotatedOffset
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
templates
Returns the value of thetemplatesrecord component.- Returns:
- the value of the
templatesrecord component
-
processors
Returns the value of theprocessorsrecord component.- Returns:
- the value of the
processorsrecord component
-