Record Class BlockDataSource
java.lang.Object
java.lang.Record
net.minecraft.network.chat.contents.data.BlockDataSource
- All Implemented Interfaces:
DataSource
public record BlockDataSource(String posPattern, @Nullable Coordinates compiledPos)
extends Record
implements DataSource
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final @Nullable CoordinatesThe field for thecompiledPosrecord component.static final com.mojang.serialization.MapCodec<BlockDataSource> private final StringThe field for theposPatternrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionBlockDataSource(String pos) BlockDataSource(String posPattern, @Nullable Coordinates compiledPos) Creates an instance of aBlockDataSourcerecord class. -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.MapCodec<BlockDataSource> codec()@Nullable CoordinatesReturns the value of thecompiledPosrecord component.private static @Nullable CoordinatescompilePos(String pos) booleanIndicates whether some other object is "equal to" this one.getData(CommandSourceStack sender) inthashCode()Returns a hash code value for this object.Returns the value of theposPatternrecord component.toString()Returns a string representation of this record class.
-
Field Details
-
posPattern
The field for theposPatternrecord component. -
compiledPos
The field for thecompiledPosrecord component. -
MAP_CODEC
-
-
Constructor Details
-
BlockDataSource
-
BlockDataSource
Creates an instance of aBlockDataSourcerecord class.- Parameters:
posPattern- the value for theposPatternrecord componentcompiledPos- the value for thecompiledPosrecord component
-
-
Method Details
-
compilePos
-
getData
- Specified by:
getDatain interfaceDataSource
-
codec
- Specified by:
codecin interfaceDataSource
-
toString
-
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). -
hashCode
-
posPattern
Returns the value of theposPatternrecord component.- Returns:
- the value of the
posPatternrecord component
-
compiledPos
Returns the value of thecompiledPosrecord component.- Returns:
- the value of the
compiledPosrecord component
-