Class PokemonBase

java.lang.Object
com.pixelmonmod.pixelmon.api.pokemon.PokemonBase
All Implemented Interfaces:
ITranslatable
Direct Known Subclasses:
Pokemon

public class PokemonBase extends Object implements ITranslatable
The most minimal values required to represent a pokemon on a player's screen Created by Jay113355 on 10/27/2018.
  • Field Details

  • Constructor Details

    • PokemonBase

      public PokemonBase()
      Default constructor
    • PokemonBase

      public PokemonBase(Pokemon pokemon)
      Copies the base of the Pokemon
      Parameters:
      pokemon - The pokemon
    • PokemonBase

      public PokemonBase(Species pokemon)
      Initializes a Pokémon in its default form, Gender.MALE, and no custom palette
      Parameters:
      pokemon - The Pokémon's pokemon.
    • PokemonBase

      public PokemonBase(Species species, Stats form)
    • PokemonBase

      public PokemonBase(Species species, Stats form, Gender gender)
      Initializes the pokemon base with no custom palette
      Parameters:
      species - The species
      form - The form
      gender - The gender
    • PokemonBase

      public PokemonBase(Species species, Stats form, PaletteProperties palette, Gender gender)
      Initializes the pokemon base with specified values
      Parameters:
      species - The species
      form - The form
      palette - The custom palette
      gender - 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 species
      form - The form
      palette - The custom palette
      gender - The gender
      ball - 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 species
      form - The form
      palette - The custom palette
      gender - The gender
      eggCycles - The egg cyles - null if not an egg
      ball - The ball the pokemon is in
  • Method Details

    • getSpecies

      public Species getSpecies()
      Gets the species of the pokemon
      Returns:
      The species
    • getForm

      public Stats 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

      public Gender getGender()
      Gets the gender of the pokemon
      Returns:
      The gender
    • getGenderProperties

      public GenderProperties getGenderProperties()
      Gets the gender properties of the pokemon
      Returns:
      Gender properties
    • getPalette

      public PaletteProperties getPalette()
      Gets the palette of the pokemon
      Returns:
      The palette
    • hasPalette

      public boolean hasPalette(String palette)
      Checks if the pokemon has the provided palette
      Parameters:
      palette - The palette
      Returns:
      True if it can have that palette
    • isPalette

      public boolean isPalette(String palette)
      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

      public boolean isPokemon(Species... species)
      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

      public boolean isPokemon(Collection<Species> species)
      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

      @SafeVarargs public final boolean isPokemonOptional(Optional<Species>... species)
      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

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

      public final boolean isPokemonOptional(Collection<Optional<Species>> species)
      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

      public final boolean isPokemonValue(Collection<RegistryValue<Species>> species)
      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

      public PokeBall getBall()
      Gets the ball the pokemon is in
      Returns:
      The ball
    • setBall

      public void setBall(PokeBall ball)
      Sets the ball the pokemon is in
      Parameters:
      ball - The new pokeball
    • setForm

      public void setForm(Stats form)
    • setForm

      public boolean setForm(String form)
    • makeEgg

      public PokemonBase 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

      public void setEggCycles(Integer eggCycles)
    • setEggCycles

      public void setEggCycles(Integer eggCycles, boolean event)
      Sets the egg cycles of the pokemon
      Parameters:
      eggCycles - The new egg cycles number
    • setPalette

      public boolean setPalette(PaletteProperties palette)
      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 the PokemonBase
      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 an CompoundTag
      Parameters:
      nbt - The nbt being written to
      Returns:
      The nbt with updated content
    • fromNBT

      public static PokemonBase fromNBT(net.minecraft.nbt.CompoundTag nbt)
    • hasChild

      public boolean hasChild(Species species)
      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

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

      public Pokemon toPokemon()