Package net.minecraft.network
Record Class HashedPatchMap
java.lang.Object
java.lang.Record
net.minecraft.network.HashedPatchMap
public record HashedPatchMap(Map<DataComponentType<?>,Integer> addedComponents, Set<DataComponentType<?>> removedComponents)
extends Record
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Map
<DataComponentType<?>, Integer> The field for theaddedComponents
record component.private final Set
<DataComponentType<?>> The field for theremovedComponents
record component.static final StreamCodec
<RegistryFriendlyByteBuf, HashedPatchMap> -
Constructor Summary
ConstructorsConstructorDescriptionHashedPatchMap
(Map<DataComponentType<?>, Integer> addedComponents, Set<DataComponentType<?>> removedComponents) Creates an instance of aHashedPatchMap
record class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theaddedComponents
record component.static HashedPatchMap
create
(DataComponentPatch p_412122_, HashedPatchMap.HashGenerator p_412570_) final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.boolean
matches
(DataComponentPatch p_412240_, HashedPatchMap.HashGenerator p_412463_) Set
<DataComponentType<?>> Returns the value of theremovedComponents
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
addedComponents
The field for theaddedComponents
record component. -
removedComponents
The field for theremovedComponents
record component. -
STREAM_CODEC
-
-
Constructor Details
-
HashedPatchMap
public HashedPatchMap(Map<DataComponentType<?>, Integer> addedComponents, Set<DataComponentType<?>> removedComponents) Creates an instance of aHashedPatchMap
record class.- Parameters:
addedComponents
- the value for theaddedComponents
record componentremovedComponents
- the value for theremovedComponents
record component
-
-
Method Details
-
create
public static HashedPatchMap create(DataComponentPatch p_412122_, HashedPatchMap.HashGenerator p_412570_) -
matches
-
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. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code 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)
. -
addedComponents
Returns the value of theaddedComponents
record component.- Returns:
- the value of the
addedComponents
record component
-
removedComponents
Returns the value of theremovedComponents
record component.- Returns:
- the value of the
removedComponents
record component
-