Class PlayerStats
java.lang.Object
com.pixelmonmod.pixelmon.api.storage.PlayerStats
Keeps track of player stats.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCaughtType(net.minecraft.core.Holder<Type> type) voidaddCaughtTypes(List<net.minecraft.core.Holder<Type>> types) voidaddExp(int amount) Adds an amount of experience to the player's experience totals.voidIncrements the total amount of Pokémon the player has hatched.voidaddKill()Adds a wild Pokémon defeat to the player's stats.voidaddLoss()Adds a loss to the player's loss count.voidIncrements the total amount of Pokémon the player has bred.voidaddWin()Adds a win to the player's win count.intgetCaughtTypeCount(net.minecraft.core.Holder<Type> type) intGets the current amount of experience the player's Pokémon have.intGets the current amount of wild Pokémon the player has defeated.intGets the amount of times the player has lost battles against other players.static voidgetNBTTags(HashMap<String, Class> tags) Gets the NBT tags associated with player stats.intGets the total amount of Pokémon the player has bred.intGets the total amount of Pokémon the player has Evolved.intGets the total amount of experience the player's Pokémon have earned.intGets the total amount of Pokémon the player has hatched.intGets the total amount of wild Pokémon the player has defeated.intgetWins()Gets the amount of times the player has won battles against other players.voidreadFromNBT(net.minecraft.nbt.CompoundTag nbt) Reads stats from NBT.voidResets the player's win and loss counts to 0.voidsetCaughtTypeCount(HashMap<net.minecraft.resources.ResourceLocation, Integer> caughtTypeCount) voidsetCurrentExp(int currentExp) Sets current amount of experience the player's Pokémon have.voidsetCurrentKills(int currentKills) Sets the current amount of wild Pokémon the player has defeated.voidsetExp(int exp) Sets the current amount of experience the player's Pokémon have.voidsetLosses(int losses) Sets the player's loss count.voidsetTotalBred(int totalBred) Sets the total amount of Pokémon the player has bred.voidsetTotalEvolved(int totalEvolved) Sets the total amount of Pokémon the player has bred.voidsetTotalExp(int totalExp) Sets the total amount of experience the player's Pokémon have earned.voidsetTotalHatched(int totalHatched) Sets the total amount of Pokémon the player has hatched.voidsetTotalKills(int totalKills) Sets the total amount of wild Pokémon the player has defeated.voidsetWins(int wins) Sets the player's win count.voidwriteToNBT(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
-
getCaughtTypeCount
-