Added Player#getExp and Player#getLevel

This commit is contained in:
themode 2020-09-20 00:27:29 +02:00
parent 4c93450520
commit 1261974420

View File

@ -1152,6 +1152,15 @@ public class Player extends LivingEntity implements CommandSender {
playerConnection.sendPacket(updateHealthPacket);
}
/**
* Get the percentage displayed in the experience bar
*
* @return the exp percentage 0-1
*/
public float getExp() {
return exp;
}
/**
* Used to change the percentage experience bar
* This cannot change the displayed level, see {@link #setLevel(int)}
@ -1165,6 +1174,15 @@ public class Player extends LivingEntity implements CommandSender {
sendExperienceUpdatePacket();
}
/**
* Get the level of the player displayed in the experience bar
*
* @return the player level
*/
public int getLevel() {
return level;
}
/**
* Used to change the level of the player
* This cannot change the displayed percentage bar see {@link #setExp(float)}