Class PlayerStats
java.lang.Object
com.pixelmonmod.pixelmon.api.storage.PlayerStats
Keeps track of player stats.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addCaughtType
(Element type) void
addCaughtTypes
(List<Element> types) void
addExp
(int amount) Adds an amount of experience to the player's experience totals.void
Increments the total amount of Pokémon the player has hatched.void
addKill()
Adds a wild Pokémon defeat to the player's stats.void
addLoss()
Adds a loss to the player's loss count.void
Increments the total amount of Pokémon the player has bred.void
addWin()
Adds a win to the player's win count.int
Gets the current amount of experience the player's Pokémon have.int
Gets the current amount of wild Pokémon the player has defeated.int
Gets the amount of times the player has lost battles against other players.static void
getNBTTags
(HashMap<String, Class> tags) Gets the NBT tags associated with player stats.int
Gets the total amount of Pokémon the player has bred.int
Gets the total amount of Pokémon the player has Evolved.int
Gets the total amount of experience the player's Pokémon have earned.int
Gets the total amount of Pokémon the player has hatched.int
Gets the total amount of wild Pokémon the player has defeated.int
getWins()
Gets the amount of times the player has won battles against other players.void
readFromNBT
(net.minecraft.nbt.CompoundTag nbt) Reads stats from NBT.void
Resets the player's win and loss counts to 0.void
setCaughtTypeCount
(HashMap<String, Integer> caughtTypeCount) void
setCurrentExp
(int currentExp) Sets current amount of experience the player's Pokémon have.void
setCurrentKills
(int currentKills) Sets the current amount of wild Pokémon the player has defeated.void
setExp
(int exp) Sets the current amount of experience the player's Pokémon have.void
setLosses
(int losses) Sets the player's loss count.void
setTotalBred
(int totalBred) Sets the total amount of Pokémon the player has bred.void
setTotalEvolved
(int totalEvolved) Sets the total amount of Pokémon the player has bred.void
setTotalExp
(int totalExp) Sets the total amount of experience the player's Pokémon have earned.void
setTotalHatched
(int totalHatched) Sets the total amount of Pokémon the player has hatched.void
setTotalKills
(int totalKills) Sets the total amount of wild Pokémon the player has defeated.void
setWins
(int wins) Sets the player's win count.void
writeToNBT
(net.minecraft.nbt.CompoundTag nbt) Writes the stats to NBT.
-
Constructor Details
-
PlayerStats
public PlayerStats()Initializes an empty set of stats.
-
-
Method Details
-
getNBTTags
Gets the NBT tags associated with player stats.- Parameters:
tags
- A map of tags to add the player stat tags to.
-
writeToNBT
public void writeToNBT(net.minecraft.nbt.CompoundTag nbt) Writes the stats to NBT.- Parameters:
nbt
- The NBT tag to write to.
-
readFromNBT
public void readFromNBT(net.minecraft.nbt.CompoundTag nbt) Reads stats from NBT.- Parameters:
nbt
- The NBT tag to read from.
-
addWin
public void addWin()Adds a win to the player's win count. -
addLoss
public void addLoss()Adds a loss to the player's loss count. -
addKill
public void addKill()Adds a wild Pokémon defeat to the player's stats. -
getCurrentKills
public int getCurrentKills()Gets the current amount of wild Pokémon the player has defeated.- Returns:
- The current amount of wild Pokémon the player has defeated.
-
setCurrentKills
public void setCurrentKills(int currentKills) Sets the current amount of wild Pokémon the player has defeated.- Parameters:
currentKills
- The new amount of wild Pokémon defeats.
-
getTotalExp
public int getTotalExp()Gets the total amount of experience the player's Pokémon have earned.- Returns:
- The total amount of experience the player's Pokémon have earned.
-
setTotalExp
public void setTotalExp(int totalExp) Sets the total amount of experience the player's Pokémon have earned.- Parameters:
totalExp
- The new current amount of experience the player's Pokémon have earned.
-
getTotalKills
public int getTotalKills()Gets the total amount of wild Pokémon the player has defeated.- Returns:
- The total amount of wild Pokémon the player has defeated.
-
setTotalKills
public void setTotalKills(int totalKills) Sets the total amount of wild Pokémon the player has defeated.- Parameters:
totalKills
- The new total amount of wild Pokémon the player has defeated.
-
getCurrentExp
public int getCurrentExp()Gets the current amount of experience the player's Pokémon have.- Returns:
- The current amount of experience the player's Pokémon have.
-
setCurrentExp
public void setCurrentExp(int currentExp) Sets current amount of experience the player's Pokémon have.- Parameters:
currentExp
- The new current amount of experience the player's Pokémon have.
-
getWins
public int getWins()Gets the amount of times the player has won battles against other players.- Returns:
- The amount of times the player has won battles against other players.
-
setWins
public void setWins(int wins) Sets the player's win count.- Parameters:
wins
- The new win count.
-
getLosses
public int getLosses()Gets the amount of times the player has lost battles against other players.- Returns:
- The amount of times the player has lost battles against other players.
-
setLosses
public void setLosses(int losses) Sets the player's loss count.- Parameters:
losses
- The new loss count.
-
addExp
public void addExp(int amount) Adds an amount of experience to the player's experience totals.- Parameters:
amount
- The amount of experience to add.
-
setExp
public void setExp(int exp) Sets the current amount of experience the player's Pokémon have.- Parameters:
exp
- The new current amount of experience the player's Pokémon have.
-
resetWinLoss
public void resetWinLoss()Resets the player's win and loss counts to 0. -
getTotalBred
public int getTotalBred()Gets the total amount of Pokémon the player has bred. -
setTotalBred
public void setTotalBred(int totalBred) Sets the total amount of Pokémon the player has bred. -
addToTotalBred
public void addToTotalBred()Increments the total amount of Pokémon the player has bred. -
getTotalHatched
public int getTotalHatched()Gets the total amount of Pokémon the player has hatched. -
setTotalHatched
public void setTotalHatched(int totalHatched) Sets the total amount of Pokémon the player has hatched. -
addHatched
public void addHatched()Increments the total amount of Pokémon the player has hatched. -
getTotalEvolved
public int getTotalEvolved()Gets the total amount of Pokémon the player has Evolved. -
setTotalEvolved
public void setTotalEvolved(int totalEvolved) Sets the total amount of Pokémon the player has bred.- Parameters:
totalEvolved
- The new total amount of Pokémon the player has bred.
-
getCaughtTypeCount
-
setCaughtTypeCount
-
addCaughtType
-
addCaughtTypes
-