Record Class WeightedStateProvider
java.lang.Object
java.lang.Record
net.minecraft.world.level.levelgen.feature.stateproviders.WeightedStateProvider
- All Implemented Interfaces:
BlockStateProvider
public record WeightedStateProvider(WeightedList<BlockState> weightedList)
extends Record
implements BlockStateProvider
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<WeightedStateProvider> private final WeightedList<BlockState> The field for theweightedListrecord component.Fields inherited from interface BlockStateProvider
DIRECT_CODEC, STATE_OR_PROVIDER_CODEC, TYPED_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionWeightedStateProvider(WeightedList.Builder<BlockState> weightedList) WeightedStateProvider(WeightedList<BlockState> weightedList) Creates an instance of aWeightedStateProviderrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.MapCodec<WeightedStateProvider> codec()final booleanIndicates whether some other object is "equal to" this one.getState(LevelAccessor level, RandomSource random, BlockPos pos) final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.Returns the value of theweightedListrecord component.Methods inherited from interface BlockStateProvider
getOptionalState
-
Field Details
-
weightedList
The field for theweightedListrecord component. -
CODEC
-
-
Constructor Details
-
WeightedStateProvider
Creates an instance of aWeightedStateProviderrecord class.- Parameters:
weightedList- the value for theweightedListrecord component
-
WeightedStateProvider
-
-
Method Details
-
codec
- Specified by:
codecin interfaceBlockStateProvider
-
getState
- Specified by:
getStatein interfaceBlockStateProvider
-
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). -
weightedList
Returns the value of theweightedListrecord component.- Returns:
- the value of the
weightedListrecord component
-