Class Species
java.lang.Object
com.pixelmonmod.pixelmon.api.pokemon.species.Species
- All Implemented Interfaces:
ITranslatable
,Comparable<Species>
A class representing each unique Pokemon
-
Field Summary
-
Constructor Summary
ConstructorDescriptionSpecies
(String name, String translationKey, int dex, int generation, Collection<String> defaultForms, Collection<Stats> forms, String json) Default constructor -
Method Summary
Modifier and TypeMethodDescriptionint
void
decode
(net.minecraft.network.FriendlyByteBuf buf) void
encode
(net.minecraft.network.FriendlyByteBuf buf) boolean
Gets aStats
for a random default form of the PokémongetDefaultFormExcluding
(String... forms) Gets aStats
for a random default form of the PokémonGets the name of the default formGets the name of the default formnet.minecraft.network.chat.MutableComponent
int
getDex()
Gets the national Pokédex number for the pokemonGets theStats
for the first default form of the PokémonGets theStats
for the first default form of the PokémonGets the form of the species from the given name.Gets the formatted national dex number (i.e.getForms()
Gets the list of all potential forms of the PokémongetForms
(boolean temporary) Gets all the forms of a species excluding, or including, temporary formsGets forms that match the given predicateint
Gets the Pokémon's generationgetJson()
getName()
Gets the English name for the Pokémonnet.minecraft.network.chat.MutableComponent
Gets the registry value for this speciesGets the English name for the Pokémon with no spaces, hyphens, or other special characters.boolean
hasFlaggedAllForms
(boolean temporary, String... flags) Checks if all the forms of the species contain the given flagsboolean
hasFlaggedForm
(boolean temporary, String... flags) Checks if any of the forms of the species contain the given flagsboolean
Checks if theSpecies
has a formboolean
hasFormWithType
(Element type) Checks if any of the forms of the species contain the type specifiedint
hashCode()
final boolean
is
(RegistryValue<Species>... species) boolean
Checks if any of the species provided in the array are equal to this species (checks by national dex number)final boolean
Checks if any of the species registry objects provided in the array are equal to this species (checks by national dex number)boolean
isDefaultForm
(Stats form) boolean
isDefaultForm
(String form) boolean
Checks if this species is legendaryboolean
Checks if this species is mythicalboolean
Checks if this species is ultrabeastMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.pixelmonmod.pixelmon.api.util.ITranslatable
getLocalizedName, getTranslatedName
-
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
Gets the English name for the Pokémon- Returns:
- The English name
-
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
Gets the formatted national dex number (i.e. 001)- Returns:
- The formatted dex number
-
getRegistryValue
Gets the registry value for this species- Returns:
- The registry value
-
getDefaultFormNames
Gets the name of the default form- Returns:
- The name
-
isDefaultForm
-
isDefaultForm
-
getDefaultForms
Gets the name of the default form- Returns:
- The name
-
getDefaultForm
Gets aStats
for a random default form of the Pokémon- Returns:
- A default form
-
getFirstForm
Gets theStats
for the first default form of the Pokémon- Returns:
- The first form
-
getDefaultFormExcluding
Gets aStats
for a random default form of the Pokémon- Returns:
- A default form
-
getForms
Gets the list of all potential forms of the Pokémon- Returns:
- All forms
-
getForm
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
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
-
hasFlaggedForm
Checks if any of the forms of the species contain the given flags- Parameters:
temporary
- If it should also include temporary forms in the searchflags
- The flags to search for- Returns:
- True if a form has one of the flags
-
hasFlaggedAllForms
Checks if all the forms of the species contain the given flags- Parameters:
temporary
- If it should also include temporary forms in the searchflags
- The flags to search for- Returns:
- True if all forms have the flags. False if at least one form doesn't.
-
hasFormWithType
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
Gets forms that match the given predicate- Parameters:
predicate
- The test case- Returns:
- The forms that match the test
-
getFirstPaletteProperties
Gets theStats
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
- Specified by:
getTranslationKey
in interfaceITranslatable
-
getNameTranslationKey
-
getDescTranslationKey
-
getNameTranslation
public net.minecraft.network.chat.MutableComponent getNameTranslation() -
getDescTranslation
public net.minecraft.network.chat.MutableComponent getDescTranslation() -
is
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
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
-
hasForm
Checks if theSpecies
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
-
hashCode
public int hashCode() -
getJson
-
compareTo
- Specified by:
compareTo
in interfaceComparable<Species>
-