public class PokemonLevel
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
int |
expToNextLevel
The experience remaining until the next pokemonLevel.
|
protected ExperienceGainType |
lastLevelType
The type of experience that gave the last level.
|
protected DelegateLink |
pixelmon
The Pokémon who has this pokemonLevel.
|
Constructor and Description |
---|
PokemonLevel(DelegateLink p)
Initializes a pokemonLevel.
|
Modifier and Type | Method and Description |
---|---|
void |
awardEXP(BattleController controller,
int experience,
ExperienceGainType type)
Awards experience to the Pokémon.
|
void |
awardEXP(int experience) |
void |
awardEXP(int experience,
ExperienceGainType type) |
boolean |
canLevelUp()
Checks if the Pokémon can pokemonLevel up.
|
int |
getExp()
Gets the amount of experience the Pokémon has.
|
int |
getExpForLevel(int level) |
int |
getExpForNextLevelClient() |
float |
getExpFraction()
Gets the fractional progress of experience to the Pokémon's next pokemonLevel.
|
static float |
getExpFraction(int exp,
int expToNextLevel)
Gets the fractional progress of experience to the Pokémon's next pokemonLevel.
|
ExperienceGainType |
getLastLevelType()
Returns the type of xp the last level-up used.
|
int |
getPokemonLevel()
Gets the Pokémon's pokemonLevel.
|
protected void |
onLevelUp(PixelmonStatsData stats)
Updates the Pokémon's stats upon leveling up.
|
void |
readFromNBT(net.minecraft.nbt.CompoundNBT var1)
Reads the Pokémon's pokemonLevel from NBT.
|
void |
recalculateXP()
Resets the Pokémon experience to the beginning of the pokemonLevel.
|
void |
setExp(int experience)
Sets the Pokémon's experience.
|
void |
setLevel(int i)
Sets the Pokémon's pokemonLevel and updates its health proportionally.
|
void |
updateExpToNextLevel()
Updates the amount of experience between the current and next levels.
|
protected void |
updateStats()
Updates a Pokémon's stats client-side.
|
void |
writeToNBT(net.minecraft.nbt.CompoundNBT var1)
Saves the Pokémon's pokemonLevel to NBT.
|
protected DelegateLink pixelmon
protected ExperienceGainType lastLevelType
public int expToNextLevel
public PokemonLevel(DelegateLink p)
p
- The Pokémon who has this pokemonLevel.protected void updateStats()
public void writeToNBT(net.minecraft.nbt.CompoundNBT var1)
var1
- The NBT tag to write to.public void readFromNBT(net.minecraft.nbt.CompoundNBT var1)
var1
- The NBT tag to read from.public int getPokemonLevel()
public void setLevel(int i)
i
- The new pokemonLevel.public ExperienceGainType getLastLevelType()
public void updateExpToNextLevel()
public int getExp()
public void setExp(int experience)
experience
- The Pokémon's experience.public boolean canLevelUp()
protected void onLevelUp(PixelmonStatsData stats)
stats
- The stats to update.public void awardEXP(int experience)
awardEXP(int, ExperienceGainType)
public void awardEXP(int experience, ExperienceGainType type)
public void awardEXP(@Nullable BattleController controller, int experience, ExperienceGainType type)
experience
- The amount of experience to award.public void recalculateXP()
public float getExpFraction()
public static float getExpFraction(int exp, int expToNextLevel)
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.public int getExpForNextLevelClient()
public int getExpForLevel(int level)