Record Class ClientboundUpdateAttributesPacket.AttributeSnapshot
java.lang.Object
java.lang.Record
net.minecraft.network.protocol.game.ClientboundUpdateAttributesPacket.AttributeSnapshot
- Enclosing class:
ClientboundUpdateAttributesPacket
public static record ClientboundUpdateAttributesPacket.AttributeSnapshot(Holder<Attribute> attribute, double base, Collection<AttributeModifier> modifiers)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe field for theattributerecord component.private final doubleThe field for thebaserecord component.static final StreamCodec<io.netty.buffer.ByteBuf, AttributeModifier> private final Collection<AttributeModifier> The field for themodifiersrecord component.static final StreamCodec<RegistryFriendlyByteBuf, ClientboundUpdateAttributesPacket.AttributeSnapshot> -
Constructor Summary
ConstructorsConstructorDescriptionAttributeSnapshot(Holder<Attribute> attribute, double base, Collection<AttributeModifier> modifiers) Creates an instance of aAttributeSnapshotrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theattributerecord component.doublebase()Returns the value of thebaserecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of themodifiersrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
attribute
The field for theattributerecord component. -
base
private final double baseThe field for thebaserecord component. -
modifiers
The field for themodifiersrecord component. -
MODIFIER_STREAM_CODEC
-
STREAM_CODEC
public static final StreamCodec<RegistryFriendlyByteBuf,ClientboundUpdateAttributesPacket.AttributeSnapshot> STREAM_CODEC
-
-
Constructor Details
-
AttributeSnapshot
public AttributeSnapshot(Holder<Attribute> attribute, double base, Collection<AttributeModifier> modifiers) Creates an instance of aAttributeSnapshotrecord class.- Parameters:
attribute- the value for theattributerecord componentbase- the value for thebaserecord componentmodifiers- the value for themodifiersrecord component
-
-
Method Details
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
attribute
Returns the value of theattributerecord component.- Returns:
- the value of the
attributerecord component
-
base
public double base()Returns the value of thebaserecord component.- Returns:
- the value of the
baserecord component
-
modifiers
Returns the value of themodifiersrecord component.- Returns:
- the value of the
modifiersrecord component
-