Class PokemonBuilder

java.lang.Object
com.pixelmonmod.pixelmon.api.pokemon.PokemonBuilder

public class PokemonBuilder extends Object
Builder class for creating a new Pokemon instance
  • Method Details

    • copy

      public static PokemonBuilder copy(Pokemon pokemon)
    • builder

      public static PokemonBuilder builder()
      Creates a new instance of a PokemonBuilder object
      Returns:
      The builder object
    • uuid

      public PokemonBuilder uuid(@Nullable UUID uuid)
      Sets the UUID Setting to null selects a random UUID
      Parameters:
      uuid - The new UUID
      Returns:
      The builder instance
    • randomSpecies

      public PokemonBuilder randomSpecies()
      Sets the species to a randomly selected species using PixelmonSpecies.getRandomSpecies()
      Returns:
      The builder instance
    • randomSpecies

      public PokemonBuilder randomSpecies(boolean excludeLegendaries, boolean excludeMythicals, boolean excludeUltraBeasts)
      Sets the species to a randomly selected species using PixelmonSpecies.getRandomSpecies(boolean, boolean, boolean)}
      Parameters:
      excludeLegendaries - - Whether or not Legendaries are included
      excludeMythicals - - Whether or not Mythicals are included
      excludeUltraBeasts - - Whether or not Ultra Beasts are included
      Returns:
      The builder instance
    • randomSpecies

      public PokemonBuilder randomSpecies(Collection<RegistryValue<Species>> excluded)
      Sets the species to a random species excluding those given
      Parameters:
      excluded - the Pokémon to exclude
      Returns:
      The builder instance
    • randomSpecies

      public PokemonBuilder randomSpecies(RegistryValue<Species>... excluded)
      Sets the species to a random species excluding those given
      Parameters:
      excluded - the Pokémon to exclude
      Returns:
      The builder instance
    • randomSpecies

      public PokemonBuilder randomSpecies(Predicate<Species> excluded)
      Sets the species to a random species excluding those set to be excluded in the predicate
      Parameters:
      excluded - the Pokémon to exclude (returning true means it will be excluded - false means it will be accepted)
      Returns:
      The builder instance
    • species

      public PokemonBuilder species(@NonNull String speciesName)
      Sets the species
      Parameters:
      speciesName - The name of the species to apply
      Returns:
      The builder instance
    • species

      public PokemonBuilder species(@NonNull RegistryValue<Species> species)
      Sets the species
      Parameters:
      species - The species registry value to apply
      Returns:
      The builder instance
    • species

      public PokemonBuilder species(@NonNull Optional<Species> species)
      Sets the species
      Parameters:
      species - The optional species to apply
      Returns:
      The builder instance
    • species

      public PokemonBuilder species(int ndex)
      Sets the species
      Parameters:
      ndex - The species national dex ID
      Returns:
      The builder instance
    • species

      public PokemonBuilder species(@NonNull Species species)
      Sets the species
      Parameters:
      species - The species to apply
      Returns:
      The builder instance
    • makeEgg

      public PokemonBuilder makeEgg()
      Makes the Pokémon an egg
      Returns:
      The builder instance
    • egg

      public PokemonBuilder egg(boolean egg)
      Makes the Pokémon an egg
      Returns:
      The builder instance
    • gender

      public PokemonBuilder gender(@NonNull Gender gender)
      Sets the gender of the Pokémon
      Parameters:
      gender - The gender to apply
      Returns:
      The builder instance
    • shiny

      public PokemonBuilder shiny()
      Sets the Pokémon palette to be shiny
      Returns:
      The builder instance
    • shiny

      public PokemonBuilder shiny(boolean shiny)
      Sets the Pokémon palette to be shiny if true, null if false
      Returns:
      The builder instance
    • palette

      public PokemonBuilder palette(@Nullable String palette)
      Sets the palette of the Pokémon Setting to null selects a random default palette from the form
      Parameters:
      palette - The palette to apply
      Returns:
      The builder instance
    • form

      public PokemonBuilder form(@NonNull Stats form)
      Sets the form of the Pokémon Setting to null selects a random default form from the species
      Parameters:
      form - The form to apply
      Returns:
      The builder instance
    • form

      public PokemonBuilder form(@Nullable String form)
      Sets the form of the Pokémon Setting to null selects a random default form from the species
      Parameters:
      form - The form to apply
      Returns:
      The builder instance
    • ability

      public PokemonBuilder ability(@Nullable Ability ability)
      Sets the ability of the Pokémon Leaving null will allow the Pokémon initialize algorithm to calculate the relevant one for the form/gender (etc)
      Parameters:
      ability - The ability to apply
      Returns:
      The builder instance
    • ability

      public PokemonBuilder ability(@Nullable RegistryValue<Ability> ability)
      Sets the ability of the Pokémon Leaving null will allow the Pokémon initialize algorithm to calculate the relevant one for the form/gender (etc)
      Parameters:
      ability - The ability to apply
      Returns:
      The builder instance
    • abilitySlot

      public PokemonBuilder abilitySlot(int slot, boolean usesHiddenAbility)
      Sets the ability slots of the Pokémon, overriding .ability() Leaving null will allow the Pokémon initialize algorithm to calculate the relevant one for the form/gender (etc)
      Parameters:
      slot - The index of the ability
      usesHiddenAbility - Whether the ability should be the hidden ability
      Returns:
      The builder instance
    • nickname

      public PokemonBuilder nickname(@Nullable String nickname)
      Sets the nickname of the Pokémon Leaving null means no nickname
      Parameters:
      nickname - The nickname to apply
      Returns:
      The builder instance
    • nickname

      public PokemonBuilder nickname(@Nullable net.minecraft.network.chat.Component nickname)
      Sets the nickname of the Pokémon Leaving null means no nickname
      Parameters:
      nickname - The nickname to apply
      Returns:
      The builder instance
    • heldItem

      public PokemonBuilder heldItem(@NonNull HeldItem heldItem)
      Sets the held item of the Pokémon
      Parameters:
      heldItem - The held item to apply
      Returns:
      The builder instance
    • heldItem

      public PokemonBuilder heldItem(@NonNull net.minecraft.world.item.ItemStack heldItem)
      Sets the held item of the Pokémon
      Parameters:
      heldItem - The held ItemStack to apply
      Returns:
      The builder instance
    • happiness

      public PokemonBuilder happiness(int friendship)
      Sets the friendship of the Pokémon
      Parameters:
      friendship - The new friendship to apply
      Returns:
      The builder instance
    • friendship

      public PokemonBuilder friendship(int friendship)
      Sets the friendship of the Pokémon
      Parameters:
      friendship - The new friendship to apply
      Returns:
      The builder instance
    • experience

      public PokemonBuilder experience(int experience)
      Sets the experience of the Pokémon
      Parameters:
      experience - The new experience to apply
      Returns:
      The builder instance
    • ev

      public PokemonBuilder ev(@NonNull BattleStatsType type, int ev)
      Sets the value of an EV
      Parameters:
      type - The type of EV
      ev - The EV value to apply
      Returns:
      The builder instance
    • iv

      public PokemonBuilder iv(@NonNull BattleStatsType type, int iv)
      Sets the value of an IV
      Parameters:
      type - The type of IV
      iv - The IV value to apply
      Returns:
      The builder instance
    • evs

      public PokemonBuilder evs(@org.checkerframework.checker.nullness.qual.NonNull int... evs)
      Sets the EVs of the Pokémon
      Parameters:
      evs - The EVs to apply
      Returns:
      The builder instance
    • ivs

      public PokemonBuilder ivs(@org.checkerframework.checker.nullness.qual.NonNull int... ivs)
      Sets the IVs of the Pokémon
      Parameters:
      ivs - The IVs to apply
      Returns:
      The builder instance
    • move

      public PokemonBuilder move(int index, @Nullable ImmutableAttack attack)
      Sets the move to the ImmutableAttack at the given index
      Parameters:
      index - The index of the move in the party (0-3)
      attack - The attack to apply
      Returns:
      The builder instance
    • move

      public PokemonBuilder move(int index, @Nullable Attack attack)
      Sets the move to the Attack at the given index
      Parameters:
      index - The index of the move in the party (0-3)
      attack - The attack to apply
      Returns:
      The builder instance
    • moves

      public PokemonBuilder moves(@NonNull Attack... moves)
      Sets the moves of the Pokémon
      Parameters:
      moves - The moves to apply
      Returns:
      The builder instance
    • moves

      @SafeVarargs public final PokemonBuilder moves(@NonNull RegistryValue<ImmutableAttack>... givenMoves)
      Sets the moves of the Pokémon
      Parameters:
      givenMoves - The moves to apply
      Returns:
      The builder instance
    • nature

      public PokemonBuilder nature(@Nullable Nature nature)
      Sets the nature of the Pokémon
      Parameters:
      nature - The nature to apply
      Returns:
      The builder instance
    • growth

      public PokemonBuilder growth(@Nullable EnumGrowth growth)
      Sets the growth of the Pokémon
      Parameters:
      growth - The growth to apply
      Returns:
      The builder instance
    • mintNature

      public PokemonBuilder mintNature(@Nullable Nature mintNature)
      Sets the mint nature of the Pokémon
      Parameters:
      mintNature - The mint nature to apply
      Returns:
      The builder instance
    • level

      public PokemonBuilder level(int level)
      Sets the level of the Pokémon
      Parameters:
      level - The level to apply
      Returns:
      The builder instance
    • caughtBall

      public PokemonBuilder caughtBall(@NonNull RegistryValue<PokeBall> caughtBall)
      Sets the ball of the Pokémon
      Parameters:
      caughtBall - The ball to apply
      Returns:
      The builder instance
    • caughtBall

      public PokemonBuilder caughtBall(@NonNull PokeBall caughtBall)
      Sets the ball of the Pokémon
      Parameters:
      caughtBall - The ball to apply
      Returns:
      The builder instance
    • extraStats

      public PokemonBuilder extraStats(@NonNull ExtraStats extraStats)
      Sets the extra stats of the Pokémon
      Parameters:
      extraStats - The extra stats for the species to apply
      Returns:
      The builder instance
    • originalTrainer

      public PokemonBuilder originalTrainer(@Nullable UUID originalTrainer, @Nullable String originalTrainerName)
      Sets the original trainer UUID of the Pokémon
      Parameters:
      originalTrainer - The original trainer's UUID
      originalTrainerName - The original trainer's name
      Returns:
      The builder instance
    • originalTrainer

      public PokemonBuilder originalTrainer(@Nullable net.minecraft.world.entity.player.Player player)
      Sets the original trainer UUID of the Pokémon
      Parameters:
      player - The original trainer to apply
      Returns:
      The builder instance
    • specs

      public PokemonBuilder specs(String... specs)
      Adds post-creation specs to apply
      Parameters:
      specs - The specs to apply
      Returns:
      The builder instance
    • specs

      public PokemonBuilder specs(Collection<String> specs)
      Adds post-creation specs to apply
      Parameters:
      specs - The specs to apply
      Returns:
      The builder instance
    • specs

      public PokemonBuilder specs(PokemonSpecification... specs)
      Adds post-creation specs to apply
      Parameters:
      specs - The specs to apply
      Returns:
      The builder instance
    • pokerus

      public PokemonBuilder pokerus(@NonNull Pokerus pokerus)
      Sets the Pokérus status of the Pokémon
      Parameters:
      pokerus - The Pokérus value to apply
      Returns:
      The builder instance
    • status

      public PokemonBuilder status(@NonNull StatusPersist status)
      Sets the status of the Pokémon
      Parameters:
      status - The status to apply
      Returns:
      The builder instance
    • healthPercent

      public PokemonBuilder healthPercent(float percent)
      Sets the current health of the Pokemon
      Parameters:
      percent - The percent of max hp
      Returns:
      The builder instance
    • gigantamaxFactor

      public PokemonBuilder gigantamaxFactor()
      Sets the Pokémon to have the Gigantamax Factor
      Returns:
      The builder instance
    • gigantamaxFactor

      public PokemonBuilder gigantamaxFactor(boolean gigantamaxFactor)
      Sets the Pokémon to have the Gigantamax Factor if true, or not if false
      Returns:
      The builder instance
    • flags

      public PokemonBuilder flags(String... flags)
      Adds flags to the Pokémon
      Parameters:
      flags - The flags
      Returns:
      The builder instance
    • flags

      public PokemonBuilder flags(Collection<String> flags)
      Adds flags to the Pokémon
      Parameters:
      flags - The flags
      Returns:
      The builder instance
    • getUuid

      public UUID getUuid()
    • getSpecies

      public Species getSpecies()
    • getPalette

      public String getPalette()
    • getForm

      public String getForm()
    • isEgg

      public boolean isEgg()
    • getGender

      public Gender getGender()
    • getAbility

      public Ability getAbility()
    • getNickname

      public net.minecraft.network.chat.Component getNickname()
    • getHeldItem

      public net.minecraft.world.item.ItemStack getHeldItem()
    • getFriendship

      public int getFriendship()
    • getIvs

      public int[] getIvs()
    • getEvs

      public int[] getEvs()
    • getMoves

      public Attack[] getMoves()
    • getNature

      public Nature getNature()
    • getMintNature

      public Nature getMintNature()
    • getLevel

      public int getLevel()
    • getExperience

      public int getExperience()
    • getGrowth

      public EnumGrowth getGrowth()
    • getCaughtBall

      public PokeBall getCaughtBall()
    • getExtraStats

      public ExtraStats getExtraStats()
    • getOriginalTrainer

      public UUID getOriginalTrainer()
    • getOriginalTrainerName

      public String getOriginalTrainerName()
    • getPokerus

      public Pokerus getPokerus()
    • getStatus

      public StatusPersist getStatus()
    • isGigantamaxFactor

      public boolean isGigantamaxFactor()
    • getFlags

      public List<String> getFlags()
    • getPokemonSpecs

      public List<String> getPokemonSpecs()
    • build

      public Pokemon build()
      Creates the Pokémon instance using the provided information
      Returns:
      The new Pokémon