java.lang.Object
com.pixelmonmod.pixelmon.api.pokemon.stats.links.PokemonLink
Direct Known Subclasses:
DelegateLink, WrapperLink

public abstract class PokemonLink extends Object
Links to a Pokémon object to get or update data.
  • Constructor Details

    • PokemonLink

      public PokemonLink()
  • Method Details

    • getPokemon

      public abstract Pokemon getPokemon()
    • getBaseStats

      public Stats getBaseStats()
      Gets the base stats of the Pokémon.
      Returns:
      The base stats of the Pokémon.
    • getStats

      public abstract PermanentStats getStats()
      Gets the numerical stats of the Pokémon.
      Returns:
      The numerical stats of the Pokémon.
    • getHeldItem

      public abstract HeldItem getHeldItem()
      Gets the Pokémon's held item.
      Returns:
      The Pokémon's held item.
    • setHeldItem

      public abstract void setHeldItem(net.minecraft.world.item.ItemStack item)
      Sets the Pokémon's held item.
      Parameters:
      item - The Pokémon's new held item.
    • getHealth

      public abstract int getHealth()
      Gets the Pokémon's current hp.
      Returns:
      The Pokémon's current hp.
    • getMaxHealth

      public abstract int getMaxHealth()
      Gets the Pokémon's maximum hp.
      Returns:
      The Pokémon's maximum hp.
    • getMaxHealth

      public abstract int getMaxHealth(boolean ignoreDynamax)
    • setHealth

      public abstract void setHealth(int health)
      Sets the Pokémon's current hp.
      Parameters:
      health - The Pokémon's current hp.
    • setHealthDirect

      public void setHealthDirect(int health)
      Directly sets the Pokémon's current hp, ignoring damage/heal processing.
      Parameters:
      health - The Pokémon's current hp.
    • getPokemonLevel

      public abstract int getPokemonLevel()
      Gets the Pokémon's pokemonLevel.
      Returns:
      The Pokémon's pokemonLevel.
    • setLevel

      public abstract void setLevel(int level)
      Sets the Pokémon's pokemonLevel.
      Parameters:
      level - The Pokémon's pokemonLevel.
    • getExp

      public abstract int getExp()
      Gets the Pokémon's experience.
      Returns:
      The Pokémon's experience.
    • setExp

      public abstract void setExp(int experience)
      Sets the Pokémon's experience.
      Parameters:
      experience - The Pokémon's experience.
    • getFriendship

      public abstract int getFriendship()
      Gets the Pokémon's friendship.
      Returns:
      The Pokémon's friendship.
    • doesLevel

      public abstract boolean doesLevel()
      Checks if the Pokémon can gain experience and pokemonLevel up.
      Returns:
      Whether the Pokémon can gain experience and pokemonLevel up.
    • getRealNickname

      public net.minecraft.network.chat.Component getRealNickname()
      Gets the Pokémon's nickname, ignoring Illusion.
      Returns:
      The Pokémon's nickname;
    • getPlayerOwner

      public abstract net.minecraft.server.level.ServerPlayer getPlayerOwner()
      Gets the player who owns the Pokémon.
      Returns:
      The player who owns the Pokémon, or null if no player owns the Pokémon.
    • getBattleController

      public abstract BattleController getBattleController()
      Gets the battle controller for the battle the Pokémon is in.
      Returns:
      The battle controller for the battle the Pokémon is in, or null if the Pokémon is not in a battle.
    • getMoveset

      public abstract Moveset getMoveset()
      Gets the Pokémon's moves.
      Returns:
      The Pokémon's moves.
    • getPokemonUUID

      public abstract UUID getPokemonUUID()
      Gets the ID of the Pokémon.
      Returns:
      The ID of the Pokémon.
    • getEntity

      public abstract PixelmonEntity getEntity()
      Gets the Pokémon entity. Sends it out if it isn't already out.
      Returns:
      The Pokémon entity.
    • setScale

      public abstract void setScale(float scale)
      Sets the model scale of the Pokémon.
      Parameters:
      scale - The model scale of the Pokémon.
    • getWorld

      public abstract net.minecraft.world.level.Level getWorld()
      Gets the world that the Pokémon is in.
      Returns:
      The world that the Pokémon is in.
    • getGender

      public abstract Gender getGender()
      Gets the Pokémon's gender.
      Returns:
      The Pokémon's gender.
    • getPos

      public abstract net.minecraft.core.BlockPos getPos()
      Gets the world position of the Pokémon.
      Returns:
      The world position of the Pokémon.
    • getStorage

      public abstract PartyStorage getStorage()
      Gets the storage of the Pokémon's owner.
      Returns:
      The storage of the Pokémon's owner.
    • update

      public abstract void update(EnumUpdateType... updateTypes)
      Updates the Pokémon client-side.
      Parameters:
      updateTypes - The types of data to update.
    • updateStats

      public abstract void updateStats()
      Updates the Pokémon's stats client-side.
    • updateLevelUp

      public abstract void updateLevelUp(PixelmonStatsData stats)
      Updates the Pokémon when it levels up.
      Parameters:
      stats - Data about the Pokémon stats after leveling up.
    • sendMessage

      public abstract void sendMessage(String langKey, Object... data)
      Sends a message to the client.
      Parameters:
      langKey - The lang key for the message.
      data - Additional arguments to pass into the lang string.
    • getNickname

      public abstract net.minecraft.network.chat.Component getNickname()
      Gets the Pokémon's nickname.
      Returns:
      The Pokémon's nickname.
    • removeStatuses

      public abstract boolean removeStatuses(StatusType... statuses)
      Removes the specified statuses from the Pokémon.
      Parameters:
      statuses - The statuses to remove.
      Returns:
      Whether a status was removed.
    • getNature

      public abstract Nature getNature()
      Gets the Pokémon's Nature.
      Returns:
      The Pokémon's Nature.
    • getExpToNextLevel

      public abstract int getExpToNextLevel()
      Gets the amount of experience needed for the Pokémon to pokemonLevel up.
      Returns:
      The amount of experience needed for the Pokémon to pokemonLevel up.
    • getPrimaryStatus

      public abstract StatusPersist getPrimaryStatus()
      Gets the non-volatile status on the Pokémon.
      Returns:
      The non-volatile status on the Pokémon.
    • getAbility

      public abstract Ability getAbility()
      Gets the Pokémon's Ability.
      Returns:
      The Pokémon's Ability.
    • getType

      public abstract List<Element> getType()
      Gets the Pokémon's type.
      Returns:
      A list of the Pokémon's types.
    • getForm

      public abstract String getForm()
      Gets the Pokémon's form name.
      Returns:
      The Pokémon's form name.
    • isFainted

      public boolean isFainted()
      Checks if the Pokémon is fainted.
      Returns:
      Whether the Pokémon is fainted.
    • isShiny

      public boolean isShiny()
    • isEgg

      public abstract boolean isEgg()
      Checks if the Pokémon is an Egg.
      Returns:
      Whether the Pokémon is an Egg.
    • getEggCycles

      public abstract int getEggCycles()
      Gets the number of Egg cycles need to hatchEgg an Egg.
      Returns:
      The number of Egg cycles need to hatchEgg an Egg.
    • getGrowth

      public EnumGrowth getGrowth()
    • getBall

      public PokeBall getBall()
    • getHeldItemStack

      public net.minecraft.world.item.ItemStack getHeldItemStack()
    • getPokerus

      public abstract Optional<Pokerus> getPokerus()
    • getSpecies

      public Species getSpecies()
      Gets the species of the Pokémon.
      Returns:
      The species of the Pokémon.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • adjustFriendship

      public abstract void adjustFriendship(int change)
      Changes the friendship of the Pokémon. Decreases in trust have a negative argument
      Parameters:
      change - The change in friendship, negative if it is a decrease of friendship.