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
-
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
-
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. -
attribute
-
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
-