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 Statsprotected Genderprotected PalettePropertiesprotected Speciesstatic final DataSync<? extends AbstractBaseEntity,PokemonBase> -
Constructor Summary
ConstructorsConstructorDescriptionDefault 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 PokemonBasefromNBT(net.minecraft.nbt.CompoundTag nbt) getBall()Gets the ball the pokemon is inintGets 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 thePokemonBasebooleanChecks if the Pokemon has a child of the given speciesbooleanhasPalette(String palette) Checks if the pokemon has the provided palettevoidbooleanChecks 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 eggbooleanChecks 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 shinymakeEgg()Turns the pokemon into an eggvoidSets the ball the pokemon is invoidsetEggCycles(Integer eggCycles) voidsetEggCycles(Integer eggCycles, boolean event) Sets the egg cycles of the pokemonvoidbooleanbooleansetPalette(PaletteProperties palette) Sets the palette properties for the Pokemonnet.minecraft.nbt.CompoundTagwriteToNBT(net.minecraft.nbt.CompoundTag nbt) Writes the values of this class into anCompoundTagMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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
ResourceLocationof 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:
getTranslationKeyin interfaceITranslatable
-
toPokemon
-