Class PersistedPet.Builder

java.lang.Object
de.Keyle.MyPet.api.entity.PersistedPet.Builder
Enclosing class:
PersistedPet

public static final class PersistedPet.Builder extends Object
Step-by-step construction of a PersistedPet, for callers setting more than one field.
  • Method Details

    • uuid

      public PersistedPet.Builder uuid(UUID v)
      Sets the pet's persistent id.
      Parameters:
      v - the value to set
      Returns:
      this builder, for chaining
    • petType

      public PersistedPet.Builder petType(PetType v)
      Sets the species; also seeds health from the type's starting HP when health is still unset.
      Parameters:
      v - the value to set
      Returns:
      this builder, for chaining
    • petName

      public PersistedPet.Builder petName(String v)
      Sets the raw name, in MiniMessage form.
      Parameters:
      v - the value to set
      Returns:
      this builder, for chaining
    • worldGroup

      public PersistedPet.Builder worldGroup(String v)
      Sets the world group; ignored when null.
      Parameters:
      v - the value to set
      Returns:
      this builder, for chaining
    • exp

      public PersistedPet.Builder exp(double v)
      Sets the accumulated experience.
      Parameters:
      v - the value to set
      Returns:
      this builder, for chaining
    • health

      public PersistedPet.Builder health(double v)
      Sets the current health.
      Parameters:
      v - the value to set
      Returns:
      this builder, for chaining
    • saturation

      public PersistedPet.Builder saturation(double v)
      Sets the hunger level.
      Parameters:
      v - the value to set
      Returns:
      this builder, for chaining
    • respawnTime

      public PersistedPet.Builder respawnTime(int v)
      Sets the respawn timer, in seconds.
      Parameters:
      v - the value to set
      Returns:
      this builder, for chaining
    • wantsToRespawn

      public PersistedPet.Builder wantsToRespawn(boolean v)
      Sets whether the pet returns on the owner's next login.
      Parameters:
      v - the value to set
      Returns:
      this builder, for chaining
    • lastUsed

      public PersistedPet.Builder lastUsed(long v)
      Sets the last-activity timestamp.
      Parameters:
      v - the value to set
      Returns:
      this builder, for chaining
    • skilltree

      public PersistedPet.Builder skilltree(Skilltree v)
      Sets the assigned skilltree.
      Parameters:
      v - the value to set
      Returns:
      this builder, for chaining
    • skillInfo

      Sets the per-skill persisted state; empty when null.
      Parameters:
      v - the value to set
      Returns:
      this builder, for chaining
    • info

      Sets the addon-owned persisted state; empty when null.
      Parameters:
      v - the value to set
      Returns:
      this builder, for chaining
    • volume

      Sets the sound-volume override; empty (inherit the owner's setting) when null.
      Parameters:
      v - the override in [0, 1], or empty to inherit
      Returns:
      this builder, for chaining
    • minDistanceStep

      public PersistedPet.Builder minDistanceStep(int v)
      Sets the personal-space step; normalized to 1..5 on build.
      Parameters:
      v - the value to set
      Returns:
      this builder, for chaining
    • maxDistanceStep

      public PersistedPet.Builder maxDistanceStep(int v)
      Sets the follow-distance step; normalized to 1..5 on build.
      Parameters:
      v - the value to set
      Returns:
      this builder, for chaining
    • build

      public PersistedPet build()
      Builds the pet.
      Returns:
      a new PersistedPet with the values set on this builder