Record Class TypedCustomData<T>
java.lang.Object
java.lang.Record
net.minestom.server.item.component.TypedCustomData<T>
- All Implemented Interfaces:
TagReadable
public record TypedCustomData<T>(T type, CompoundBinaryTag nbt)
extends Record
implements TagReadable
-
Constructor Summary
ConstructorsConstructorDescriptionTypedCustomData(T type, CompoundBinaryTag nbt) Creates an instance of aTypedCustomDatarecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Codec<TypedCustomData<T>> final booleanIndicates whether some other object is "equal to" this one.<TT> @UnknownNullability TTReads the specified tag.final inthashCode()Returns a hash code value for this object.nbt()Returns the value of thenbtrecord component.static <T> NetworkBuffer.Type<TypedCustomData<T>> networkType(NetworkBuffer.Type<T> typeNetwork) final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.<TT> TypedCustomData<T> Methods inherited from interface TagReadable
hasTag
-
Constructor Details
-
TypedCustomData
Creates an instance of aTypedCustomDatarecord class.- Parameters:
type- the value for thetyperecord componentnbt- the value for thenbtrecord component
-
-
Method Details
-
codec
-
networkType
public static <T> NetworkBuffer.Type<TypedCustomData<T>> networkType(NetworkBuffer.Type<T> typeNetwork) -
getTag
Description copied from interface:TagReadableReads the specified tag.- Specified by:
getTagin interfaceTagReadable- Type Parameters:
TT- the tag type- Parameters:
tag- the tag to read- Returns:
- the read tag, null if not present
-
withTag
-
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). -
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
nbt
Returns the value of thenbtrecord component.- Returns:
- the value of the
nbtrecord component
-