Class DexData
java.lang.Object
com.pixelmonmod.pixelmon.api.pokedex.data.DexData
- All Implemented Interfaces:
PokedexStorage
- Direct Known Subclasses:
PlayerDexData
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected int
protected final net.minecraft.resources.ResourceKey
<Pokedex> protected int
protected Map
<PokemonBase, PokedexState> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Gets the type of the Pokedex.int
Counts the number of Pokémon caught.int
Counts the number of Pokémon seen.int
getCaughtCount
(Region region) Gets the count of Pokémon caught in a specific region.int
getCaughtCount
(PokemonBase species) Gets the count of Pokémon caught for a specific species.double
getLargest
(PokemonBase pokemon) Gets the largest size of the Pokémon species that has been captured.double
getPercentage
(Region region, PokedexRegistrationStatus status) Gets the percentage of Pokémon in a specific region that match the given status.double
Gets the percentage of the Pokedex that is matching the given status.int
getSeenCount
(Region region) Gets the count of Pokémon seen in a specific region.int
getSeenCount
(PokemonBase pokemon) Gets the count of Pokémon seen for a specific species.double
getSmallest
(PokemonBase pokemon) Gets the smallest size of the Pokémon species that has been captured.getState
(PokemonBase species) Gets the registration status of the Pokémon.getStatus
(PokemonBase species) Gets the registration status of the species.getUnlockedSections
(PokemonBase species) Gets the unlocked sections for a Pokémon species.void
load
(net.minecraft.nbt.CompoundTag nbt, net.minecraft.core.RegistryAccess registryAccess) Loads the Pokedex data from a CompoundTag.net.minecraft.nbt.CompoundTag
save
(net.minecraft.core.RegistryAccess registryAccess) Saves the Pokedex data to a CompoundTag.void
Sets the Pokémon as caught.void
Sets the Pokémon as seen.void
unlockSection
(PokemonBase pokemon, PokedexSection section) Unlocks a section for a Pokémon species.protected boolean
updateState
(PokemonBase base, UnaryOperator<PokedexState> stateConsumer) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.pixelmonmod.pixelmon.api.pokedex.PokedexStorage
getCaughtCount, getLargest, getOwner, getSeenCount, getSmallest, getUniqueId, getUnlockedSections, hasCaught, hasCaught, hasSeen, hasSeen, hasUnlocked, hasUnlocked, initialize, unlockSection, unlockSections, unlockSections, unlockSections, unlockSections
-
Field Details
-
pokedexType
-
status
-
seenCount
protected int seenCount -
caughtCount
protected int caughtCount
-
-
Constructor Details
-
DexData
-
-
Method Details
-
getPercentage
Description copied from interface:PokedexStorage
Gets the percentage of the Pokedex that is matching the given status.- Specified by:
getPercentage
in interfacePokedexStorage
- Parameters:
status
- The status to check against.- Returns:
- The percentage of the Pokedex that matches the given status.
-
getPercentage
Description copied from interface:PokedexStorage
Gets the percentage of Pokémon in a specific region that match the given status.- Specified by:
getPercentage
in interfacePokedexStorage
- 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
Description copied from interface:PokedexStorage
Gets the count of Pokémon seen in a specific region.- Specified by:
getSeenCount
in interfacePokedexStorage
- Parameters:
region
- The region to check.- Returns:
- The count of Pokémon seen in the region.
-
getCaughtCount
Description copied from interface:PokedexStorage
Gets the count of Pokémon caught in a specific region.- Specified by:
getCaughtCount
in interfacePokedexStorage
- Parameters:
region
- The region to check.- Returns:
- The count of Pokémon caught in the region.
-
getSeenCount
Description copied from interface:PokedexStorage
Gets the count of Pokémon seen for a specific species.- Specified by:
getSeenCount
in interfacePokedexStorage
- Parameters:
pokemon
- The species to check.- Returns:
- The count of Pokémon seen for the species.
-
getCaughtCount
Description copied from interface:PokedexStorage
Gets the count of Pokémon caught for a specific species.- Specified by:
getCaughtCount
in interfacePokedexStorage
- Parameters:
species
- The species to check.- Returns:
- The count of Pokémon caught for the species.
-
getLargest
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 interfacePokedexStorage
- Parameters:
pokemon
- The species to check.- Returns:
- The largest size of the Pokémon species.
-
getSmallest
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 interfacePokedexStorage
- Parameters:
pokemon
- The species to check.- Returns:
- The smallest size of the Pokémon species.
-
getStatus
Description copied from interface:PokedexStorage
Gets the registration status of the Pokémon.- Specified by:
getStatus
in interfacePokedexStorage
- Parameters:
pokemon
- The Pokémon to check.- Returns:
- The registration status of the Pokémon.
-
getStatus
Description copied from interface:PokedexStorage
Gets the registration status of the species.- Specified by:
getStatus
in interfacePokedexStorage
- Parameters:
species
- The species to check.- Returns:
- The registration status of the species.
-
getState
-
setSeen
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 interfacePokedexStorage
- Parameters:
pokemon
- The Pokémon to set as seen.
-
setCaught
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 interfacePokedexStorage
- Parameters:
pokemon
- The Pokémon to set as caught.
-
getUnlockedSections
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 interfacePokedexStorage
- Parameters:
species
- The Pokémon species to check.- Returns:
- A list of unlocked sections for the Pokémon species.
-
unlockSection
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 interfacePokedexStorage
- 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 interfacePokedexStorage
- 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 interfacePokedexStorage
- 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 interfacePokedexStorage
-
updateState
-
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 interfacePokedexStorage
- 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 interfacePokedexStorage
- Parameters:
nbt
- The CompoundTag containing the Pokedex data.registryAccess
- The registry access for loading.
-