Record Class StructureSet.StructureSelectionEntry
java.lang.Object
java.lang.Record
net.minecraft.world.level.levelgen.structure.StructureSet.StructureSelectionEntry
- Enclosing class:
- StructureSet
public static record StructureSet.StructureSelectionEntry(Holder<ConfiguredStructureFeature<?,?>> structure, int weight)
extends Record
-
Field Summary
Modifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<StructureSet.StructureSelectionEntry>
private final Holder<ConfiguredStructureFeature<?,
?>> The field for thestructure
record component.private final int
The field for theweight
record component. -
Constructor Summary
ConstructorDescriptionStructureSelectionEntry
(Holder<ConfiguredStructureFeature<?, ?>> structure, int weight) Creates an instance of aStructureSelectionEntry
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.boolean
generatesInMatchingBiome
(Predicate<Holder<Biome>> p_210036_) final int
hashCode()
Returns a hash code value for this object.Returns the value of thestructure
record component.final String
toString()
Returns a string representation of this record class.int
weight()
Returns the value of theweight
record component.
-
Field Details
-
structure
The field for thestructure
record component. -
weight
private final int weightThe field for theweight
record component. -
CODEC
-
-
Constructor Details
-
StructureSelectionEntry
Creates an instance of aStructureSelectionEntry
record class.- Parameters:
structure
- the value for thestructure
record componentweight
- the value for theweight
record component
-
-
Method Details
-
generatesInMatchingBiome
-
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 '=='. -
structure
Returns the value of thestructure
record component.- Returns:
- the value of the
structure
record component
-
weight
public int weight()Returns the value of theweight
record component.- Returns:
- the value of the
weight
record component
-