Record Class BlockDataSource
java.lang.Object
java.lang.Record
net.minecraft.network.chat.contents.BlockDataSource
- All Implemented Interfaces:
DataSource
public record BlockDataSource(String posPattern, @Nullable Coordinates compiledPos)
extends Record
implements DataSource
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.network.chat.contents.DataSource
DataSource.Type<T extends DataSource> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final CoordinatesThe field for thecompiledPosrecord component.private final StringThe field for theposPatternrecord component.static final com.mojang.serialization.MapCodec<BlockDataSource> static final DataSource.Type<BlockDataSource> Fields inherited from interface net.minecraft.network.chat.contents.DataSource
CODEC -
Constructor Summary
ConstructorsConstructorDescriptionBlockDataSource(String p_237312_) BlockDataSource(String posPattern, Coordinates compiledPos) Creates an instance of aBlockDataSourcerecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecompiledPosrecord component.private static CoordinatescompilePos(String p_237318_) booleanIndicates whether some other object is "equal to" this one.getData(CommandSourceStack p_237323_) inthashCode()Returns a hash code value for this object.Returns the value of theposPatternrecord component.toString()Returns a string representation of this record class.type()
-
Field Details
-
posPattern
The field for theposPatternrecord component. -
compiledPos
The field for thecompiledPosrecord component. -
SUB_CODEC
-
TYPE
-
-
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
-
type
- Specified by:
typein interfaceDataSource
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
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
public int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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
-