Record Class RotatedBlockProvider
java.lang.Object
java.lang.Record
net.minecraft.world.level.levelgen.feature.stateproviders.RotatedBlockProvider
- All Implemented Interfaces:
BlockStateProvider
public record RotatedBlockProvider(Holder<BlockStateProvider> state, Optional<Direction> direction)
extends Record
implements BlockStateProvider
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<RotatedBlockProvider> The field for thedirectionrecord component.private final Holder<BlockStateProvider> The field for thestaterecord component.Fields inherited from interface BlockStateProvider
DIRECT_CODEC, STATE_OR_PROVIDER_CODEC, TYPED_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionRotatedBlockProvider(Holder<BlockStateProvider> state, Optional<Direction> direction) Creates an instance of aRotatedBlockProviderrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.MapCodec<RotatedBlockProvider> codec()Returns the value of thedirectionrecord component.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. -
direction
-
CODEC
-
-
Constructor Details
-
RotatedBlockProvider
-
RotatedBlockProvider
Creates an instance of aRotatedBlockProviderrecord class.- Parameters:
state- the value for thestaterecord componentdirection- the value for thedirectionrecord 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
-
direction
-