/** * Construct a new wrapped attribute builder initialized to the values from a template. * @param template - the attribute template. * @return The new builder. */ public static Builder newBuilder(@Nonnull WrappedAttribute template) { return new Builder(Preconditions.checkNotNull(template, "template cannot be NULL.")); }
attributeKey, baseValue, getUnwrappedModifiers());
WrappedAttribute.Builder builder = WrappedAttribute.newBuilder().attributeKey("generic.maxHealth"); builder.baseValue(((LivingWatcher) disguise.getWatcher()).getMaxHealth()); } else if (DisguiseConfig.isMaxHealthDeterminedByDisguisedEntity() && disguisedEntity instanceof Damageable) { builder.baseValue(((Damageable) disguisedEntity).getMaxHealth()); } else { builder.baseValue(DisguiseValues.getDisguiseValues(disguise.getType()).getMaxHealth()); builder.packet(packet); attributes.add(builder.build());
builder.attributeKey("generic.maxHealth"); builder.baseValue(((LivingWatcher) disguise.getWatcher()).getMaxHealth()); } else if (DisguiseConfig.isMaxHealthDeterminedByDisguisedEntity()) { builder = WrappedAttribute.newBuilder(attribute); } else { builder = WrappedAttribute.newBuilder(); builder.attributeKey("generic.maxHealth"); builder.baseValue(DisguiseValues.getDisguiseValues(disguise.getType()).getMaxHealth()); builder.packet(updateAttributes); attributes.add(builder.build()); break;
builder.attributeKey("generic.maxHealth"); builder.baseValue(getMaxHealth()); builder.packet(packet); attributes.add(builder.build());
/** * Construct a new wrapped attribute builder. * @return The new builder. */ public static Builder newBuilder() { return new Builder(null); }
/** * Construct an attribute with the same key and name, but a different list of modifiers. * @param modifiers - attribute modifiers. * @return The new attribute. */ public WrappedAttribute withModifiers(Collection<WrappedAttributeModifier> modifiers) { return newBuilder(this).modifiers(modifiers).build(); }