Class PlayerPokedex

java.lang.Object
com.pixelmonmod.pixelmon.api.pokedex.PlayerPokedex
Direct Known Subclasses:
ClientPlayerPokedex

public class PlayerPokedex extends Object
Displays Pokémon data for seen and caught Pokémon.
  • Field Details

    • uuid

      public UUID uuid
      The player who this Pokédex keeps track of.
    • formDex

      public com.google.common.collect.Table<Integer,Short,Short> formDex
      Tracker for unique forms seen by the player. Key is nat number, array index is form number, array value is number encountered
  • Constructor Details

    • PlayerPokedex

      public PlayerPokedex()
      Initializes a Pokédex with no owner.
    • PlayerPokedex

      public PlayerPokedex(UUID uuid)
      Registers a Pokédex to its owner.
      Parameters:
      uuid - The UUID of the player who this Pokédex keeps track of.
  • Method Details

    • setUUID

      public PlayerPokedex setUUID(UUID uuid)
    • readFromNBT

      public net.minecraft.nbt.CompoundTag readFromNBT(net.minecraft.nbt.CompoundTag nbt)
      Reads Pokédex register status from NBT.
      Parameters:
      nbt - The NBT tag to read from.
      Returns:
      The NBT tag that was read from.
    • getSeenMap

      public Map<Integer,PokedexRegistrationStatus> getSeenMap()
      Gets the register status map for the Pokédex. HIGHLY recommended to use other methods to edit this
      Returns:
      The register status map for the Pokédex.
    • getSeenCompletionPercentage

      public float getSeenCompletionPercentage()
      Gets the seen completion percentage of the player
      Returns:
      The completion percentage
    • getCaughtCompletionPercentage

      public float getCaughtCompletionPercentage()
      Gets the caught completion percentage of the player
      Returns:
      The completion percentage
    • writeToNBT

      public net.minecraft.nbt.CompoundTag writeToNBT(net.minecraft.nbt.CompoundTag nbt)
      Writes the register status map to NBT.
      Parameters:
      nbt - The NBT tag to write to.
      Returns:
      The NBT tag that was written to.
    • update

      public void update()
      Sends Pokédex data to the client player.
    • set

      public boolean set(Pokemon pokemon, PokedexRegistrationStatus drs)
      Sets an entry in the register status map.
      Parameters:
      pokemon - The Pokémon to modify register status for.
      drs - The new register status to assign to the Pokémon.
      Returns:
      if the value has been updated to the given one.
    • set

      public boolean set(int id, PokedexRegistrationStatus drs)
      Sets an entry in the register status map.
      Parameters:
      id - The National Pokédex number of the Pokémon to modify register status for.
      drs - The new register status to assign to the Pokémon.
      Returns:
      if the value has been updated to the given one.
    • set

      public static boolean set(UUID playerUUID, Pokemon id, PokedexRegistrationStatus drs)
    • wipe

      public void wipe()
    • get

      public PokedexRegistrationStatus get(int id)
      Gets the register status of a Pokémon.
      Parameters:
      id - The National Pokédex number of the Pokémon.
      Returns:
      The register status of the Pokémon.
    • getEntry

      public PokedexEntry getEntry(int id)
      Gets the entry through the registry status of the Pokemon
      Parameters:
      id - The National Pokédex number of the Pokémon.
      Returns:
      The per-player entry for the Pokemon
    • isRegistered

      public boolean isRegistered(Species species)
      Checks if a Pokémon has been seen or caught.
      Parameters:
      species - The species to check.
      Returns:
      true if the Pokémon has been seen or caught, false otherwise.
    • hasSeen

      public boolean hasSeen(Species species)
      Checks if a Pokémon has been seen.
      Parameters:
      species - The species to check.
      Returns:
      true if the Pokémon has been seen or caught, false otherwise.
    • hasCaught

      public boolean hasCaught(Species species)
      Checks if a Pokémon has been caught.
      Parameters:
      species - The species to check.
      Returns:
      true if the Pokémon has been caught, false otherwise.
    • countCaught

      public int countCaught()
      Counts the number of Pokémon the player has caught.
      Returns:
      The number of Pokémon the player has caught.
    • countCaught

      public int countCaught(int generation)
      Counts the number of Pokémon the player has caught.
      Parameters:
      generation - The generation to check
      Returns:
      The number of Pokémon the player has caught.
    • countSeen

      public int countSeen()
      Counts the number of Pokémon the player has seen.
      Returns:
      The number of Pokémon the player has seen.
    • countSeen

      public int countSeen(int generation)
      Counts the number of Pokémon the player has seen.
      Parameters:
      generation - The generation to check
      Returns:
      The number of Pokémon the player has seen.
    • setSeenMap

      public void setSeenMap(Map<Integer,PokedexRegistrationStatus> seenMap)
      Don't use this
    • seenForms

      public Map<Short,Short> seenForms(Species species)
    • checkForOvalCharm

      public void checkForOvalCharm()
    • checkForCharms

      public void checkForCharms()
    • checkForShinyCharm

      public void checkForShinyCharm()
    • setSeenList

      public void setSeenList(HashMap<Integer,PokedexRegistrationStatus> data)
      Sets the Pokédex's register status map.
      Parameters:
      data - The new register status map.