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 theaddedComponentsrecord component.private final Set<DataComponentType<?>> The field for theremovedComponentsrecord component.static final StreamCodec<RegistryFriendlyByteBuf, HashedPatchMap> -
Constructor Summary
ConstructorsConstructorDescriptionHashedPatchMap(Map<DataComponentType<?>, Integer> addedComponents, Set<DataComponentType<?>> removedComponents) Creates an instance of aHashedPatchMaprecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theaddedComponentsrecord component.static HashedPatchMapcreate(DataComponentPatch pPatch, HashedPatchMap.HashGenerator pHashGenerator) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanmatches(DataComponentPatch pPatch, HashedPatchMap.HashGenerator pHashGenerator) Set<DataComponentType<?>> Returns the value of theremovedComponentsrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
addedComponents
The field for theaddedComponentsrecord component. -
removedComponents
The field for theremovedComponentsrecord component. -
STREAM_CODEC
-
-
Constructor Details
-
HashedPatchMap
public HashedPatchMap(Map<DataComponentType<?>, Integer> addedComponents, Set<DataComponentType<?>> removedComponents) Creates an instance of aHashedPatchMaprecord class.- Parameters:
addedComponents- the value for theaddedComponentsrecord componentremovedComponents- the value for theremovedComponentsrecord component
-
-
Method Details
-
create
public static HashedPatchMap create(DataComponentPatch pPatch, HashedPatchMap.HashGenerator pHashGenerator) -
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 theaddedComponentsrecord component.- Returns:
- the value of the
addedComponentsrecord component
-
removedComponents
Returns the value of theremovedComponentsrecord component.- Returns:
- the value of the
removedComponentsrecord component
-