Class PlayerPokedex
java.lang.Object
com.pixelmonmod.pixelmon.api.pokedex.PlayerPokedex
- Direct Known Subclasses:
ClientPlayerPokedex
Displays Pokémon data for seen and caught Pokémon.
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
ConstructorDescriptionInitializes a Pokédex with no owner.PlayerPokedex
(UUID uuid) Registers a Pokédex to its owner. -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
void
int
Counts the number of Pokémon the player has caught.int
countCaught
(int generation) Counts the number of Pokémon the player has caught.int
Counts the number of Pokémon the player has seen.int
countSeen
(int generation) Counts the number of Pokémon the player has seen.get
(int id) Gets the register status of a Pokémon.float
Gets the caught completion percentage of the playergetEntry
(int id) Gets the entry through the registry status of the Pokemonfloat
Gets the seen completion percentage of the playerGets the register status map for the Pokédex.boolean
Checks if a Pokémon has been caught.boolean
Checks if a Pokémon has been seen.boolean
isRegistered
(Species species) Checks if a Pokémon has been seen or caught.net.minecraft.nbt.CompoundTag
readFromNBT
(net.minecraft.nbt.CompoundTag nbt) Reads Pokédex register status from NBT.boolean
set
(int id, PokedexRegistrationStatus drs) Sets an entry in the register status map.boolean
set
(Pokemon pokemon, PokedexRegistrationStatus drs) Sets an entry in the register status map.static boolean
set
(UUID playerUUID, Pokemon id, PokedexRegistrationStatus drs) void
Sets the Pokédex's register status map.void
setSeenMap
(Map<Integer, PokedexRegistrationStatus> seenMap) Don't use thisvoid
update()
Sends Pokédex data to the client player.void
wipe()
net.minecraft.nbt.CompoundTag
writeToNBT
(net.minecraft.nbt.CompoundTag nbt) Writes the register status map to NBT.
-
Field Details
-
uuid
The player who this Pokédex keeps track of. -
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
Registers a Pokédex to its owner.- Parameters:
uuid
- The UUID of the player who this Pokédex keeps track of.
-
-
Method Details
-
setUUID
-
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
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
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
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
-
wipe
public void wipe() -
get
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
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
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
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
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
Don't use this -
seenForms
-
checkForOvalCharm
public void checkForOvalCharm() -
checkForCharms
public void checkForCharms() -
checkForShinyCharm
public void checkForShinyCharm() -
setSeenList
Sets the Pokédex's register status map.- Parameters:
data
- The new register status map.
-