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
Modifier and TypeFieldDescriptionThe field for theattribute
record component.private final double
The field for thebase
record component.static final StreamCodec
<io.netty.buffer.ByteBuf, AttributeModifier> private final Collection
<AttributeModifier> The field for themodifiers
record component.static final StreamCodec
<RegistryFriendlyByteBuf, ClientboundUpdateAttributesPacket.AttributeSnapshot> -
Constructor Summary
ConstructorDescriptionAttributeSnapshot
(Holder<Attribute> attribute, double base, Collection<AttributeModifier> modifiers) Creates an instance of aAttributeSnapshot
record class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theattribute
record component.double
base()
Returns the value of thebase
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.Returns the value of themodifiers
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
attribute
The field for theattribute
record component. -
base
private final double baseThe field for thebase
record component. -
modifiers
The field for themodifiers
record 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 aAttributeSnapshot
record class.- Parameters:
attribute
- the value for theattribute
record componentbase
- the value for thebase
record componentmodifiers
- the value for themodifiers
record 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 theattribute
record component.- Returns:
- the value of the
attribute
record component
-
base
public double base()Returns the value of thebase
record component.- Returns:
- the value of the
base
record component
-
modifiers
Returns the value of themodifiers
record component.- Returns:
- the value of the
modifiers
record component
-