Class PokemonBase
java.lang.Object
com.pixelmonmod.pixelmon.api.pokemon.PokemonBase
- All Implemented Interfaces:
ITranslatable
- Direct Known Subclasses:
Pokemon
The most minimal values required to represent a pokemon on a player's screen
Created by Jay113355 on 10/27/2018.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected PokeBallprotected intprotected intprotected Stringprotected Genderprotected Stringstatic final DataSync<? extends AbstractBaseEntity, PokemonBase> -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructorPokemonBase(int dexId, String form, Gender gender, String palette) PokemonBase(int dexId, String form, Gender gender, String palette, int eggCycles, PokeBall ball) PokemonBase(Pokemon pokemon) Copies the base of the PokemonPokemonBase(Species pokemon) Initializes a Pokémon in its default form,Gender.MALE, and no custom palettePokemonBase(Species species, Stats form) PokemonBase(Species species, Stats form, Gender gender) Initializes the pokemon base with no custom palettePokemonBase(Species species, Stats form, PaletteProperties palette, Gender gender) Initializes the pokemon base with specified valuesPokemonBase(Species species, Stats form, PaletteProperties palette, Gender gender, int eggCycles, PokeBall ball) Initializes the pokemon base with specified valuesPokemonBase(Species species, Stats form, PaletteProperties palette, Gender gender, PokeBall ball) Initializes the pokemon base with specified values -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic PokemonBasefromNBT(net.minecraft.nbt.CompoundTag nbt) getBall()Gets the ball the pokemon is inintgetDex()intGets the number of egg cycles for the pokemongetForm()Gets the form of the pokemonGets the gender of the pokemonGets the gender properties of the pokemonGets the palette of the pokemonGets the species of the pokemonnet.minecraft.resources.ResourceLocationGets the relevant sprite for thePokemonBasegetTypes()Gets the types of the pokemonbooleanChecks if the Pokemon has a child of the given speciesinthashCode()booleanhasPalette(String palette) Checks if the pokemon has the provided palettebooleanChecks if the form of the pokemon is the default form for the speciesbooleanChecks if the palette of the poekmon is the default palette for the formbooleanisEgg()Checks if the pokemon is an eggbooleanA method for checking if a palette is one of Magikarp's palettes from Magikarp Jump.booleanA method for checking if a palette is one of Clobbopus' palettes that Pixelmon adds, based on Magikarp Jump.booleanA method for checking if a palette is one of Magikarp's palettes from Magikarp Jump.booleanA method for checking if a palette is one of Shellos' palettes that Pixelmon adds, based on Magikarp Jump.booleanA method for checking if a palette is one of Slugma's palettes that Pixelmon adds, based on Magikarp Jump.booleanA method for checking if a palette is one of Spheal's palettes that Pixelmon adds, based on Magikarp Jump.booleanChecks if the palette of the pokemon is the given namebooleanChecks if the given pokemon is one of the ones providedbooleanisPokemon(Collection<Species> species) Checks if the given pokemon is one of the ones providedfinal booleanisPokemonOptional(RegistryValue<Species>... species) final booleanisPokemonOptional(Collection<Optional<Species>> species) Checks if the given pokemon is one of the ones providedfinal booleanisPokemonOptional(Optional<Species>... species) Checks if the given pokemon is one of the ones providedfinal booleanisPokemonValue(Collection<RegistryValue<Species>> species) Checks if the given pokemon is one of the ones providedbooleanisShiny()Short cut method for checking if a pokemon is shinybooleanChecks if the Pokemon is of the given type.booleanChecks if the Pokemon is of the given type.makeEgg()Turns the pokemon into an eggvoidSets the ball the pokemon is inprotected voidsetDex(int dex) voidsetEggCycles(Integer eggCycles) voidsetEggCycles(Integer eggCycles, boolean event) Sets the egg cycles of the pokemonvoidbooleanprotected voidsetFormName(String formName) booleansetPalette(PaletteProperties palette) Sets the palette properties for the Pokemonprotected voidsetPaletteName(String paletteName) toString()net.minecraft.nbt.CompoundTagwriteToNBT(net.minecraft.nbt.CompoundTag nbt, net.minecraft.core.HolderLookup.Provider registryAccess) Writes the values of this class into anCompoundTagMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.pixelmonmod.pixelmon.api.util.ITranslatable
getLocalizedName, getTranslatedName
-
Field Details
-
SYNC_POKEMON_BASE
-
dex
protected int dex -
formName
-
paletteName
-
gender
-
ball
-
eggCycles
protected int eggCycles
-
-
Constructor Details
-
PokemonBase
public PokemonBase()Default constructor -
PokemonBase
-
PokemonBase
-
PokemonBase
Copies the base of the Pokemon- Parameters:
pokemon- The pokemon
-
PokemonBase
Initializes a Pokémon in its default form,Gender.MALE, and no custom palette- Parameters:
pokemon- The Pokémon's pokemon.
-
PokemonBase
-
PokemonBase
Initializes the pokemon base with no custom palette- Parameters:
species- The speciesform- The formgender- The gender
-
PokemonBase
Initializes the pokemon base with specified values- Parameters:
species- The speciesform- The formpalette- The custom palettegender- The gender
-
PokemonBase
public PokemonBase(Species species, Stats form, PaletteProperties palette, Gender gender, PokeBall ball) Initializes the pokemon base with specified values- Parameters:
species- The speciesform- The formpalette- The custom palettegender- The genderball- The ball the pokemon is in
-
PokemonBase
public PokemonBase(Species species, Stats form, PaletteProperties palette, Gender gender, int eggCycles, PokeBall ball) Initializes the pokemon base with specified values- Parameters:
species- The speciesform- The formpalette- The custom palettegender- The gendereggCycles- The egg cyles - null if not an eggball- The ball the pokemon is in
-
-
Method Details
-
getDex
public int getDex() -
setDex
protected void setDex(int dex) -
getFormName
-
setFormName
-
getPaletteName
-
setPaletteName
-
getSpecies
Gets the species of the pokemon- Returns:
- The species
-
getForm
Gets the form of the pokemon- Returns:
- The form
-
getTypes
Gets the types of the pokemon- Returns:
- The types
-
isType
Checks if the Pokemon is of the given type.- Parameters:
type- The type to check against.- Returns:
- True if the Pokemon is of the given type, false otherwise.
-
isType
Checks if the Pokemon is of the given type.- Parameters:
type- The type to check against.- Returns:
- True if the Pokemon is of the given type, false otherwise.
-
isDefaultForm
public boolean isDefaultForm()Checks if the form of the pokemon is the default form for the species- Returns:
- The default form
-
isDefaultPalette
public boolean isDefaultPalette()Checks if the palette of the poekmon is the default palette for the form- Returns:
- true if default
-
getGender
Gets the gender of the pokemon- Returns:
- The gender
-
getGenderProperties
Gets the gender properties of the pokemon- Returns:
- Gender properties
-
getPalette
Gets the palette of the pokemon- Returns:
- The palette
-
hasPalette
Checks if the pokemon has the provided palette- Parameters:
palette- The palette- Returns:
- True if it can have that palette
-
isPalette
Checks if the palette of the pokemon is the given name- Parameters:
palette- The name of the palette being checked for- Returns:
- True if a match
-
isShiny
public boolean isShiny()Short cut method for checking if a pokemon is shiny- Returns:
- True if shiny
-
isJumpPalette
public boolean isJumpPalette()A method for checking if a palette is one of Magikarp's palettes from Magikarp Jump.- Returns:
- True if the Pokémon has a palette only caught with an appraised fishing rod.
-
isJumpPaletteForMagikarp
public boolean isJumpPaletteForMagikarp()A method for checking if a palette is one of Magikarp's palettes from Magikarp Jump.- Returns:
- True if the Pokémon has a palette only caught with an appraised fishing rod.
-
isJumpPaletteForSlugma
public boolean isJumpPaletteForSlugma()A method for checking if a palette is one of Slugma's palettes that Pixelmon adds, based on Magikarp Jump.- Returns:
- True if the Pokémon has a palette only caught with an appraised fishing rod.
-
isJumpPaletteForSpheal
public boolean isJumpPaletteForSpheal()A method for checking if a palette is one of Spheal's palettes that Pixelmon adds, based on Magikarp Jump.- Returns:
- True if the Pokémon has a palette only caught with an appraised fishing rod.
-
isJumpPaletteForShellos
public boolean isJumpPaletteForShellos()A method for checking if a palette is one of Shellos' palettes that Pixelmon adds, based on Magikarp Jump.- Returns:
- True if the Pokémon has a palette only caught with an appraised fishing rod.
-
isJumpPaletteForClobbopus
public boolean isJumpPaletteForClobbopus()A method for checking if a palette is one of Clobbopus' palettes that Pixelmon adds, based on Magikarp Jump.- Returns:
- True if the Pokémon has a palette only caught with an appraised fishing rod.
-
isPokemon
Checks if the given pokemon is one of the ones provided- Parameters:
species- The array of species being checked- Returns:
- True if it matches one of the given species
-
isPokemon
Checks if the given pokemon is one of the ones provided- Parameters:
species- The collection of species being checked- Returns:
- True if it matches one of the given species
-
isPokemonOptional
Checks if the given pokemon is one of the ones provided- Parameters:
species- The array of species being checked- Returns:
- True if it matches one of the given species
-
isPokemonOptional
-
isPokemonOptional
Checks if the given pokemon is one of the ones provided- Parameters:
species- The collection of species being checked- Returns:
- True if it matches one of the given species
-
isPokemonValue
Checks if the given pokemon is one of the ones provided- Parameters:
species- The collection of species being checked- Returns:
- True if it matches one of the given species
-
getBall
Gets the ball the pokemon is in- Returns:
- The ball
-
setBall
Sets the ball the pokemon is in- Parameters:
ball- The new pokeball
-
setForm
-
setForm
-
makeEgg
Turns the pokemon into an egg- Returns:
- Itself
-
isEgg
public boolean isEgg()Checks if the pokemon is an egg- Returns:
- If the pokemon is egg
-
getEggCycles
public int getEggCycles()Gets the number of egg cycles for the pokemon- Returns:
- The egg cycles
-
setEggCycles
-
setEggCycles
Sets the egg cycles of the pokemon- Parameters:
eggCycles- The new egg cycles number
-
setPalette
Sets the palette properties for the Pokemon- Parameters:
palette- The new palette properties- Returns:
- Successful (always true)
-
getSprite
public net.minecraft.resources.ResourceLocation getSprite()Gets the relevant sprite for thePokemonBase- Returns:
- The
ResourceLocationof the sprite
-
writeToNBT
public net.minecraft.nbt.CompoundTag writeToNBT(net.minecraft.nbt.CompoundTag nbt, net.minecraft.core.HolderLookup.Provider registryAccess) Writes the values of this class into anCompoundTag- Parameters:
nbt- The nbt being written to- Returns:
- The nbt with updated content
-
fromNBT
-
hasChild
Checks if the Pokemon has a child of the given species- Parameters:
species- The child species being checked- Returns:
- True if one of the pre-evolutions is the same species as the child
-
getTranslationKey
- Specified by:
getTranslationKeyin interfaceITranslatable
-
toPokemon
-
equals
-
hashCode
public int hashCode() -
toString
-