Record Class DataComponentPatch.PatchKey
java.lang.Object
java.lang.Record
net.minecraft.core.component.DataComponentPatch.PatchKey
- Enclosing class:
DataComponentPatch
private static record DataComponentPatch.PatchKey(DataComponentType<?> type, boolean removed)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<DataComponentPatch.PatchKey> private final booleanThe field for theremovedrecord component.private final DataComponentType<?> The field for thetyperecord component. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivatePatchKey(DataComponentType<?> type, boolean removed) Creates an instance of aPatchKeyrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanremoved()Returns the value of theremovedrecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.com.mojang.serialization.Codec<?>
-
Field Details
-
type
The field for thetyperecord component. -
removed
private final boolean removedThe field for theremovedrecord component. -
CODEC
-
-
Constructor Details
-
PatchKey
Creates an instance of aPatchKeyrecord class.- Parameters:
type- the value for thetyperecord componentremoved- the value for theremovedrecord component
-
-
Method Details
-
valueCodec
public com.mojang.serialization.Codec<?> valueCodec() -
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
removed
public boolean removed()Returns the value of theremovedrecord component.- Returns:
- the value of the
removedrecord component
-