java.lang.Object
com.pixelmonmod.pixelmon.api.pokedex.data.DexData
All Implemented Interfaces:
PokedexStorage
Direct Known Subclasses:
PlayerDexData

public abstract class DexData extends Object implements PokedexStorage
  • Field Details

    • pokedexType

      protected final net.minecraft.resources.ResourceKey<Pokedex> pokedexType
    • status

      protected Map<PokemonBase,PokedexState> status
    • seenCount

      protected int seenCount
    • caughtCount

      protected int caughtCount
  • Constructor Details

    • DexData

      protected DexData(net.minecraft.resources.ResourceKey<Pokedex> pokedexType)
  • Method Details

    • getPercentage

      public double getPercentage(PokedexRegistrationStatus status)
      Description copied from interface: PokedexStorage
      Gets the percentage of the Pokedex that is matching the given status.
      Specified by:
      getPercentage in interface PokedexStorage
      Parameters:
      status - The status to check against.
      Returns:
      The percentage of the Pokedex that matches the given status.
    • getPercentage

      public double getPercentage(Region region, PokedexRegistrationStatus status)
      Description copied from interface: PokedexStorage
      Gets the percentage of Pokémon in a specific region that match the given status.
      Specified by:
      getPercentage in interface PokedexStorage
      Parameters:
      region - The region to check.
      status - The status to check against.
      Returns:
      The percentage of Pokémon in the region that matches the given status.
    • getSeenCount

      public int getSeenCount(Region region)
      Description copied from interface: PokedexStorage
      Gets the count of Pokémon seen in a specific region.
      Specified by:
      getSeenCount in interface PokedexStorage
      Parameters:
      region - The region to check.
      Returns:
      The count of Pokémon seen in the region.
    • getCaughtCount

      public int getCaughtCount(Region region)
      Description copied from interface: PokedexStorage
      Gets the count of Pokémon caught in a specific region.
      Specified by:
      getCaughtCount in interface PokedexStorage
      Parameters:
      region - The region to check.
      Returns:
      The count of Pokémon caught in the region.
    • getSeenCount

      public int getSeenCount(PokemonBase pokemon)
      Description copied from interface: PokedexStorage
      Gets the count of Pokémon seen for a specific species.
      Specified by:
      getSeenCount in interface PokedexStorage
      Parameters:
      pokemon - The species to check.
      Returns:
      The count of Pokémon seen for the species.
    • getCaughtCount

      public int getCaughtCount(PokemonBase species)
      Description copied from interface: PokedexStorage
      Gets the count of Pokémon caught for a specific species.
      Specified by:
      getCaughtCount in interface PokedexStorage
      Parameters:
      species - The species to check.
      Returns:
      The count of Pokémon caught for the species.
    • getLargest

      public double getLargest(PokemonBase pokemon)
      Description copied from interface: PokedexStorage
      Gets the largest size of the Pokémon species that has been captured.
      This method will return the largest size of the Pokémon species that was captured with this dex.
      Specified by:
      getLargest in interface PokedexStorage
      Parameters:
      pokemon - The species to check.
      Returns:
      The largest size of the Pokémon species.
    • getSmallest

      public double getSmallest(PokemonBase pokemon)
      Description copied from interface: PokedexStorage
      Gets the smallest size of the Pokémon species that has been captured.
      This method will return the smallest size of the Pokémon species that was captured with this dex.
      Specified by:
      getSmallest in interface PokedexStorage
      Parameters:
      pokemon - The species to check.
      Returns:
      The smallest size of the Pokémon species.
    • getStatus

      public PokedexRegistrationStatus getStatus(Pokemon pokemon)
      Description copied from interface: PokedexStorage
      Gets the registration status of the Pokémon.
      Specified by:
      getStatus in interface PokedexStorage
      Parameters:
      pokemon - The Pokémon to check.
      Returns:
      The registration status of the Pokémon.
    • getStatus

      public PokedexRegistrationStatus getStatus(PokemonBase species)
      Description copied from interface: PokedexStorage
      Gets the registration status of the species.
      Specified by:
      getStatus in interface PokedexStorage
      Parameters:
      species - The species to check.
      Returns:
      The registration status of the species.
    • getState

      public PokedexState getState(PokemonBase species)
    • setSeen

      public void setSeen(Pokemon pokemon, String cause)
      Description copied from interface: PokedexStorage
      Sets the Pokémon as seen.
      This method will not change the status if the Pokémon has already been caught or seen.
      Specified by:
      setSeen in interface PokedexStorage
      Parameters:
      pokemon - The Pokémon to set as seen.
    • setCaught

      public void setCaught(Pokemon pokemon, String cause)
      Description copied from interface: PokedexStorage
      Sets the Pokémon as caught.
      This method will not change the status if the Pokémon has already been caught or seen.
      Specified by:
      setCaught in interface PokedexStorage
      Parameters:
      pokemon - The Pokémon to set as caught.
    • getUnlockedSections

      public List<PokedexSection> getUnlockedSections(PokemonBase species)
      Description copied from interface: PokedexStorage
      Gets the unlocked sections for a Pokémon species.
      This method will return the sections that are unlocked for the given Pokémon species.
      Specified by:
      getUnlockedSections in interface PokedexStorage
      Parameters:
      species - The Pokémon species to check.
      Returns:
      A list of unlocked sections for the Pokémon species.
    • unlockSection

      public void unlockSection(PokemonBase pokemon, PokedexSection section)
      Description copied from interface: PokedexStorage
      Unlocks a section for a Pokémon species.
      This method will unlock the section for the given Pokémon species.
      Specified by:
      unlockSection in interface PokedexStorage
      Parameters:
      pokemon - The Pokémon species to unlock the section for.
      section - The section to unlock.
    • countSeen

      public int countSeen()
      Description copied from interface: PokedexStorage
      Counts the number of Pokémon seen.
      Specified by:
      countSeen in interface PokedexStorage
      Returns:
      The count of seen Pokémon.
    • countCaught

      public int countCaught()
      Description copied from interface: PokedexStorage
      Counts the number of Pokémon caught.
      Specified by:
      countCaught in interface PokedexStorage
      Returns:
      The count of caught Pokémon.
    • clear

      public void clear()
      Description copied from interface: PokedexStorage
      Gets the type of the Pokedex.
      Specified by:
      clear in interface PokedexStorage
    • updateState

      protected boolean updateState(PokemonBase base, UnaryOperator<PokedexState> stateConsumer)
    • save

      public net.minecraft.nbt.CompoundTag save(net.minecraft.core.RegistryAccess registryAccess)
      Description copied from interface: PokedexStorage
      Saves the Pokedex data to a CompoundTag.
      Specified by:
      save in interface PokedexStorage
      Parameters:
      registryAccess - The registry access for saving.
      Returns:
      The CompoundTag containing the Pokedex data.
    • load

      public void load(net.minecraft.nbt.CompoundTag nbt, net.minecraft.core.RegistryAccess registryAccess)
      Description copied from interface: PokedexStorage
      Loads the Pokedex data from a CompoundTag.
      Specified by:
      load in interface PokedexStorage
      Parameters:
      nbt - The CompoundTag containing the Pokedex data.
      registryAccess - The registry access for loading.