mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-23 08:46:44 +01:00
Implemented player experience methods
By: Dinnerbone <dinnerbone@dinnerbone.com>
This commit is contained in:
parent
ca1be0ff66
commit
7f0060f3a0
1 changed files with 28 additions and 0 deletions
|
@ -396,4 +396,32 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||||
public GameMode getGameMode() {
|
public GameMode getGameMode() {
|
||||||
return GameMode.getByValue(getHandle().itemInWorldManager.a());
|
return GameMode.getByValue(getHandle().itemInWorldManager.a());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getExperience() {
|
||||||
|
return getHandle().exp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExperience(int exp) {
|
||||||
|
getHandle().d(exp);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getLevel() {
|
||||||
|
return getHandle().expLevel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLevel(int level) {
|
||||||
|
getHandle().expLevel = level;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getTotalExperience() {
|
||||||
|
return getHandle().expTotal;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTotalExperience(int exp) {
|
||||||
|
getHandle().expTotal = exp;
|
||||||
|
|
||||||
|
if (getTotalExperience() > getExperience()) {
|
||||||
|
getHandle().exp = getTotalExperience();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue