java.lang.Object
com.pixelmonmod.pixelmon.api.pokemon.species.Species
All Implemented Interfaces:
ITranslatable, Comparable<Species>

public class Species extends Object implements ITranslatable, Comparable<Species>
A class representing each unique Pokemon
  • Field Details

    • GSON

      public static final com.google.gson.Gson GSON
  • Constructor Details

    • Species

      public Species(String name, String translationKey, int dex, int generation, Collection<String> defaultForms, Collection<Stats> forms, String json)
      Default constructor
      Parameters:
      name - The English name of the species.
      dex - The national Pokédex number.
      defaultForms - The Pokémon's default forms.
      forms - All potential forms of the Pokémon.
  • Method Details

    • getName

      public String getName()
      Gets the English name for the Pokémon
      Returns:
      The English name
    • getStrippedName

      public String getStrippedName()
      Gets the English name for the Pokémon with no spaces, hyphens, or other special characters.
      Returns:
      The stripped English name
    • getDex

      public int getDex()
      Gets the national Pokédex number for the pokemon
      Returns:
      The national dex number
    • getFormattedDex

      public String getFormattedDex()
      Gets the formatted national dex number (i.e. 001)
      Returns:
      The formatted dex number
    • getRegistryValue

      public RegistryValue<Species> getRegistryValue()
      Gets the registry value for this species
      Returns:
      The registry value
    • getDefaultFormNames

      public List<String> getDefaultFormNames()
      Gets the name of the default form
      Returns:
      The name
    • isDefaultForm

      public boolean isDefaultForm(String form)
    • isDefaultForm

      public boolean isDefaultForm(Stats form)
    • getDefaultForms

      public List<Stats> getDefaultForms()
      Gets the name of the default form
      Returns:
      The name
    • getDefaultForm

      public Stats getDefaultForm()
      Gets a Stats for a random default form of the Pokémon
      Returns:
      A default form
    • getFirstForm

      public Stats getFirstForm()
      Gets the Stats for the first default form of the Pokémon
      Returns:
      The first form
    • getDefaultFormExcluding

      public Stats getDefaultFormExcluding(String... forms)
      Gets a Stats for a random default form of the Pokémon
      Returns:
      A default form
    • getForms

      public List<Stats> getForms()
      Gets the list of all potential forms of the Pokémon
      Returns:
      All forms
    • getForm

      public Stats getForm(String formName)
      Gets the form of the species from the given name. Will return null if not found
      Parameters:
      formName - The name of the form
      Returns:
      The found form
    • getForms

      public List<Stats> getForms(boolean temporary)
      Gets all the forms of a species excluding, or including, temporary forms
      Parameters:
      temporary - If temporary forms should be included
      Returns:
      All forms for the species
    • getForms

      public List<Stats> getForms(String... tags)
    • hasFlaggedForm

      public boolean hasFlaggedForm(boolean temporary, String... flags)
      Checks if any of the forms of the species contain the given flags
      Parameters:
      temporary - If it should also include temporary forms in the search
      flags - The flags to search for
      Returns:
      True if a form has one of the flags
    • hasFlaggedAllForms

      public boolean hasFlaggedAllForms(boolean temporary, String... flags)
      Checks if all the forms of the species contain the given flags
      Parameters:
      temporary - If it should also include temporary forms in the search
      flags - The flags to search for
      Returns:
      True if all forms have the flags. False if at least one form doesn't.
    • hasFormWithType

      public boolean hasFormWithType(Element type)
      Checks if any of the forms of the species contain the type specified
      Parameters:
      type - The type to search against
      Returns:
      True if a form has the specified type
    • getForms

      public List<Stats> getForms(Predicate<Stats> predicate)
      Gets forms that match the given predicate
      Parameters:
      predicate - The test case
      Returns:
      The forms that match the test
    • getFirstPaletteProperties

      public PaletteProperties getFirstPaletteProperties()
      Gets the Stats for the first default form of the Pokémon
      Returns:
      The first form
    • getGeneration

      public int getGeneration()
      Gets the Pokémon's generation
      Returns:
      The generation
    • getTranslationKey

      public String getTranslationKey()
      Specified by:
      getTranslationKey in interface ITranslatable
    • getNameTranslationKey

      public String getNameTranslationKey()
    • getDescTranslationKey

      public String getDescTranslationKey()
    • getNameTranslation

      public net.minecraft.network.chat.MutableComponent getNameTranslation()
    • getDescTranslation

      public net.minecraft.network.chat.MutableComponent getDescTranslation()
    • is

      public boolean is(Species... species)
      Checks if any of the species provided in the array are equal to this species (checks by national dex number)
      Parameters:
      species - The species to check
      Returns:
      Whether a match was found
    • is

      @SafeVarargs public final boolean is(Optional<Species>... species)
      Checks if any of the species registry objects provided in the array are equal to this species (checks by national dex number)
      Parameters:
      species - The species to check
      Returns:
      Whether a match was found
    • is

      @SafeVarargs public final boolean is(RegistryValue<Species>... species)
    • hasForm

      public boolean hasForm(String form)
      Checks if the Species has a form
      Returns:
      True if the form is present
    • isLegendary

      public boolean isLegendary()
      Checks if this species is legendary
      Returns:
      True if legendary
    • isUltraBeast

      public boolean isUltraBeast()
      Checks if this species is ultrabeast
      Returns:
      True if ultrabeast
    • isMythical

      public boolean isMythical()
      Checks if this species is mythical
      Returns:
      True if mythical
    • decode

      public void decode(net.minecraft.network.FriendlyByteBuf buf)
    • encode

      public void encode(net.minecraft.network.FriendlyByteBuf buf)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getJson

      public String getJson()
    • compareTo

      public int compareTo(Species species)
      Specified by:
      compareTo in interface Comparable<Species>