Record Class BlockPositionSource
java.lang.Object
java.lang.Record
net.minecraft.world.level.gameevent.BlockPositionSource
- All Implemented Interfaces:
PositionSource
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<BlockPositionSource> private final BlockPosThe field for theposrecord component.static final StreamCodec<io.netty.buffer.ByteBuf, BlockPositionSource> -
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance of aBlockPositionSourcerecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.getPosition(Level level) getType()final inthashCode()Returns a hash code value for this object.pos()Returns the value of theposrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
pos
The field for theposrecord component. -
CODEC
-
STREAM_CODEC
-
-
Constructor Details
-
BlockPositionSource
Creates an instance of aBlockPositionSourcerecord class.- Parameters:
pos- the value for theposrecord component
-
-
Method Details
-
getPosition
- Specified by:
getPositionin interfacePositionSource
-
getType
- Specified by:
getTypein interfacePositionSource
-
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). -
pos
Returns the value of theposrecord component.- Returns:
- the value of the
posrecord component
-