Record Class SimpleStateProvider
java.lang.Object
java.lang.Record
net.minecraft.world.level.levelgen.feature.stateproviders.SimpleStateProvider
- All Implemented Interfaces:
BlockStateProvider
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<SimpleStateProvider> private final BlockStateThe field for thestaterecord component.Fields inherited from interface BlockStateProvider
DIRECT_CODEC, STATE_OR_PROVIDER_CODEC, TYPED_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionSimpleStateProvider(BlockState state) Creates an instance of aSimpleStateProviderrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.MapCodec<SimpleStateProvider> 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.state()Returns the value of thestaterecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from interface BlockStateProvider
getOptionalState
-
Field Details
-
state
The field for thestaterecord component. -
CODEC
-
-
Constructor Details
-
SimpleStateProvider
Creates an instance of aSimpleStateProviderrecord class.- Parameters:
state- the value for thestaterecord component
-
-
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). -
state
Returns the value of thestaterecord component.- Returns:
- the value of the
staterecord component
-