Class PokemonLevel
java.lang.Object
com.pixelmonmod.pixelmon.api.pokemon.stats.PokemonLevel
- Direct Known Subclasses:
TempBattlePokemonLevel
A Pokémon's pokemonLevel.
-
Field Summary
FieldsModifier and TypeFieldDescriptionintThe experience remaining until the next pokemonLevel.protected ExperienceGainTypeThe type of experience that gave the last level.protected DelegateLinkThe Pokémon who has this pokemonLevel. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidawardEXP(int experience) voidawardEXP(int experience, ExperienceGainType type) voidawardEXP(BattleController controller, int experience, ExperienceGainType type) Awards experience to the Pokémon.booleanChecks if the Pokémon can pokemonLevel up.intgetExp()Gets the amount of experience the Pokémon has.intgetExpForLevel(int level) intfloatGets the fractional progress of experience to the Pokémon's next pokemonLevel.static floatgetExpFraction(int exp, int expToNextLevel) Gets the fractional progress of experience to the Pokémon's next pokemonLevel.Returns the type of xp the last level-up used.intGets the Pokémon's pokemonLevel.protected voidonLevelUp(PixelmonStatsData stats) Updates the Pokémon's stats upon leveling up.voidreadFromNBT(net.minecraft.nbt.CompoundTag var1) Reads the Pokémon's pokemonLevel from NBT.voidResets the Pokémon experience to the beginning of the pokemonLevel.voidsetExp(int experience) Sets the Pokémon's experience.voidsetLevel(int i) Sets the Pokémon's pokemonLevel and updates its health proportionally.voidUpdates the amount of experience between the current and next levels.protected voidUpdates a Pokémon's stats client-side.voidwriteToNBT(net.minecraft.nbt.CompoundTag var1) Saves the Pokémon's pokemonLevel to NBT.
-
Field Details
-
pixelmon
The Pokémon who has this pokemonLevel. -
lastLevelType
The type of experience that gave the last level. -
expToNextLevel
public int expToNextLevelThe experience remaining until the next pokemonLevel.
-
-
Constructor Details
-
PokemonLevel
Initializes a pokemonLevel.- Parameters:
p- The Pokémon who has this pokemonLevel.
-
-
Method Details
-
updateStats
protected void updateStats()Updates a Pokémon's stats client-side. -
writeToNBT
public void writeToNBT(net.minecraft.nbt.CompoundTag var1) Saves the Pokémon's pokemonLevel to NBT.- Parameters:
var1- The NBT tag to write to.
-
readFromNBT
public void readFromNBT(net.minecraft.nbt.CompoundTag var1) Reads the Pokémon's pokemonLevel from NBT.- Parameters:
var1- The NBT tag to read from.
-
getPokemonLevel
public int getPokemonLevel()Gets the Pokémon's pokemonLevel.- Returns:
- The Pokémon's pokemonLevel.
-
setLevel
public void setLevel(int i) Sets the Pokémon's pokemonLevel and updates its health proportionally.- Parameters:
i- The new pokemonLevel.
-
getLastLevelType
Returns the type of xp the last level-up used. -
updateExpToNextLevel
public void updateExpToNextLevel()Updates the amount of experience between the current and next levels. -
getExp
public int getExp()Gets the amount of experience the Pokémon has.- Returns:
- The amount of experience the Pokémon has
-
setExp
public void setExp(int experience) Sets the Pokémon's experience.- Parameters:
experience- The Pokémon's experience.
-
canLevelUp
public boolean canLevelUp()Checks if the Pokémon can pokemonLevel up.- Returns:
- Whether the Pokémon can pokemonLevel up.
-
onLevelUp
Updates the Pokémon's stats upon leveling up.- Parameters:
stats- The stats to update.
-
awardEXP
public void awardEXP(int experience) - See Also:
-
awardEXP
-
awardEXP
public void awardEXP(@Nullable BattleController controller, int experience, ExperienceGainType type) Awards experience to the Pokémon.- Parameters:
experience- The amount of experience to award.
-
recalculateXP
public void recalculateXP()Resets the Pokémon experience to the beginning of the pokemonLevel. -
getExpFraction
public float getExpFraction()Gets the fractional progress of experience to the Pokémon's next pokemonLevel.- Returns:
- The fractional progress of experience to the Pokémon's next pokemonLevel.
-
getExpFraction
public static float getExpFraction(int exp, int expToNextLevel) Gets the fractional progress of experience to the Pokémon's next pokemonLevel.- Parameters:
exp- The amount of experience the Pokémon has currently gained in the pokemonLevel.expToNextLevel- The amount of experience between the Pokémon current and next levels.- Returns:
- The fractional progress of experience to the Pokémon's next pokemonLevel.
-
getExpForNextLevelClient
public int getExpForNextLevelClient() -
getExpForLevel
public int getExpForLevel(int level)
-