Package com.comphenix.protocol.wrappers
Class WrappedAttribute.Builder
java.lang.Object
com.comphenix.protocol.wrappers.WrappedAttribute.Builder
- Enclosing class:
- WrappedAttribute
Represents a builder for wrapped attributes.
Use WrappedAttribute.newBuilder() to construct it.
- Author:
- Kristian
-
Method Summary
Modifier and TypeMethodDescriptionattributeKey(String attributeKey)Set the unique attribute key that identifies its function.baseValue(double baseValue)Change the base value of the attribute.build()Build a new wrapped attribute with the values of this builder.modifiers(Collection<WrappedAttributeModifier> modifiers)Set the modifers that will be supplied to the client, and used to compute the final value.packet(PacketContainer packet)Set the parent update attributes packet (44).
-
Method Details
-
baseValue
Change the base value of the attribute.The modifiers will automatically supply a value if this is unset.
- Parameters:
baseValue- - the base value value.- Returns:
- This builder, for chaining.
-
attributeKey
Set the unique attribute key that identifies its function.This is required.
- Parameters:
attributeKey- - the unique attribute key.- Returns:
- This builder, for chaining.
-
modifiers
Set the modifers that will be supplied to the client, and used to compute the final value.- Parameters:
modifiers- - the attribute modifiers.- Returns:
- This builder, for chaining.
-
packet
Set the parent update attributes packet (44).- Parameters:
packet- - the parent packet.- Returns:
- This builder, for chaining.
-
build
Build a new wrapped attribute with the values of this builder.- Returns:
- The wrapped attribute.
- Throws:
RuntimeException- If anything went wrong with the reflection.
-