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
Modifier and TypeFieldDescriptionprotected PokeBall
protected int
protected Stats
protected Gender
protected PaletteProperties
protected Species
static final DataSync<? extends AbstractBaseEntity,
PokemonBase> -
Constructor Summary
ConstructorDescriptionDefault constructorPokemonBase
(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 TypeMethodDescriptionstatic PokemonBase
fromNBT
(net.minecraft.nbt.CompoundTag nbt) getBall()
Gets the ball the pokemon is inint
Gets 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.ResourceLocation
Gets the relevant sprite for thePokemonBase
boolean
Checks if the Pokemon has a child of the given speciesboolean
hasPalette
(String palette) Checks if the pokemon has the provided palettevoid
boolean
Checks if the form of the pokemon is the default form for the speciesboolean
Checks if the palette of the poekmon is the default palette for the formboolean
isEgg()
Checks if the pokemon is an eggboolean
Checks if the palette of the pokemon is the given nameboolean
Checks if the given pokemon is one of the ones providedboolean
isPokemon
(Collection<Species> species) Checks if the given pokemon is one of the ones providedfinal boolean
isPokemonOptional
(RegistryValue<Species>... species) final boolean
isPokemonOptional
(Collection<Optional<Species>> species) Checks if the given pokemon is one of the ones providedfinal boolean
isPokemonOptional
(Optional<Species>... species) Checks if the given pokemon is one of the ones providedfinal boolean
isPokemonValue
(Collection<RegistryValue<Species>> species) Checks if the given pokemon is one of the ones providedboolean
isShiny()
Short cut method for checking if a pokemon is shinymakeEgg()
Turns the pokemon into an eggvoid
Sets the ball the pokemon is invoid
setEggCycles
(Integer eggCycles) void
setEggCycles
(Integer eggCycles, boolean event) Sets the egg cycles of the pokemonvoid
boolean
boolean
setPalette
(PaletteProperties palette) Sets the palette properties for the Pokemonnet.minecraft.nbt.CompoundTag
writeToNBT
(net.minecraft.nbt.CompoundTag nbt) Writes the values of this class into anCompoundTag
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.pixelmonmod.pixelmon.api.util.ITranslatable
getLocalizedName, getTranslatedName
-
Field Details
-
SYNC_POKEMON_BASE
-
species
-
form
-
gender
-
palette
-
ball
-
eggCycles
protected int eggCycles
-
-
Constructor Details
-
PokemonBase
public PokemonBase()Default constructor -
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
-
getSpecies
Gets the species of the pokemon- Returns:
- The species
-
getForm
Gets the form of the pokemon- Returns:
- The form
-
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
-
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
ResourceLocation
of the sprite
-
writeToNBT
public net.minecraft.nbt.CompoundTag writeToNBT(net.minecraft.nbt.CompoundTag nbt) 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
-
invalidate
public void invalidate() -
getTranslationKey
- Specified by:
getTranslationKey
in interfaceITranslatable
-
toPokemon
-