Record Class Random
java.lang.Object
java.lang.Record
net.minecraft.world.level.levelgen.structure.pools.alias.Random
- All Implemented Interfaces:
- PoolAliasBinding
record Random(ResourceKey<StructureTemplatePool> alias, SimpleWeightedRandomList<ResourceKey<StructureTemplatePool>> targets)
extends Record
implements PoolAliasBinding
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprivate final ResourceKey<StructureTemplatePool>The field for thealiasrecord component.(package private) static com.mojang.serialization.Codec<Random>private final SimpleWeightedRandomList<ResourceKey<StructureTemplatePool>>The field for thetargetsrecord component.
- 
Constructor SummaryConstructorsConstructorDescriptionRandom(ResourceKey<StructureTemplatePool> alias, SimpleWeightedRandomList<ResourceKey<StructureTemplatePool>> targets) Creates an instance of aRandomrecord class.
- 
Method SummaryModifier and TypeMethodDescriptionalias()Returns the value of thealiasrecord component.com.mojang.serialization.Codec<Random>codec()final booleanIndicates whether some other object is "equal to" this one.voidforEachResolved(RandomSource p_307661_, BiConsumer<ResourceKey<StructureTemplatePool>, ResourceKey<StructureTemplatePool>> p_307635_) final inthashCode()Returns a hash code value for this object.targets()Returns the value of thetargetsrecord component.final StringtoString()Returns a string representation of this record class.
- 
Field Details- 
aliasThe field for thealiasrecord component.
- 
targetsThe field for thetargetsrecord component.
- 
CODEC
 
- 
- 
Constructor Details- 
RandomRandom(ResourceKey<StructureTemplatePool> alias, SimpleWeightedRandomList<ResourceKey<StructureTemplatePool>> targets) Creates an instance of aRandomrecord class.- Parameters:
- alias- the value for the- aliasrecord component
- targets- the value for the- targetsrecord component
 
 
- 
- 
Method Details- 
forEachResolvedpublic void forEachResolved(RandomSource p_307661_, BiConsumer<ResourceKey<StructureTemplatePool>, ResourceKey<StructureTemplatePool>> p_307635_) - Specified by:
- forEachResolvedin interface- PoolAliasBinding
 
- 
allTargets- Specified by:
- allTargetsin interface- PoolAliasBinding
 
- 
codec- Specified by:
- codecin interface- PoolAliasBinding
 
- 
toStringReturns 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.
- 
hashCodepublic 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.
- 
equalsIndicates 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).
- 
aliasReturns the value of thealiasrecord component.- Returns:
- the value of the aliasrecord component
 
- 
targetsReturns the value of thetargetsrecord component.- Returns:
- the value of the targetsrecord component
 
 
-