public class ExperienceCalculator
extends java.lang.Object
Constructor and Description |
---|
ExperienceCalculator() |
Modifier and Type | Method and Description |
---|---|
static double |
applyExperienceBonus(org.bukkit.entity.Player player,
double experience)
Applies experience bonuses, based on the passive stats of the player.
|
static int |
getExpToLevel(int level)
Gets the amount of exp needed to reach the next player level.
|
static int |
grantExperience(org.bukkit.entity.Player player,
int tier,
double earnedxp)
Gives experience points to the player and levels them up, if 100% is reached.
|
static int |
grantExperience(org.bukkit.entity.Player player,
int tier,
double earnedxp,
org.bukkit.Location location)
Gives experience points to the player and levels them up, if 100% is reached.
|
static int |
grantExperience(org.bukkit.entity.Player player,
int tier,
double earnedxp,
org.bukkit.Location location,
boolean shared)
Gives experience points to the player and levels them up, if 100% is reached.
|
static void |
updateExperienceBar(org.bukkit.entity.Player player)
Updates the experience bar of a player.
|
public static void updateExperienceBar(org.bukkit.entity.Player player)
player
- The player to update the bar.public static int grantExperience(org.bukkit.entity.Player player, int tier, double earnedxp)
player
- The player to receive the exp.tier
- The tier (max player level) for the exp reward.earnedxp
- The earned exp without modifiers.grantExperience(Player, int, double, Location, boolean)
public static int grantExperience(org.bukkit.entity.Player player, int tier, double earnedxp, org.bukkit.Location location)
player
- The player to receive the exp.tier
- The tier (max player level) for the exp reward.earnedxp
- The earned exp without modifiers.location
- The location for an exp indicator or null for none.grantExperience(Player, int, double, Location, boolean)
public static int grantExperience(org.bukkit.entity.Player player, int tier, double earnedxp, org.bukkit.Location location, boolean shared)
player
- The player to receive the exp.tier
- The tier (max player level) for the exp reward.earnedxp
- The earned exp without modifiers.location
- The location for an exp indicator or null for none.shared
- If the exp was already shared (25%) with group members.WauzCore.MAX_PLAYER_LEVEL
,
applyExperienceBonus(Player, double)
,
ValueIndicator.spawnExpIndicator(Location, int)
,
PlayerCollectionConfigurator.levelUpCharacter(Player)
,
PlayerCollectionConfigurator.setCharacterExperience(Player, double)
public static double applyExperienceBonus(org.bukkit.entity.Player player, double experience)
player
- The player that will earn the exp.experience
- The exp without bonus.EquipmentUtils.getExperienceBonus(ItemStack)
public static int getExpToLevel(int level)
level
- The next level to be reached.