mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-02 21:17:00 +01:00
[Bleeding] Fixed setTotalExp, any experience update bugs and removed Deprecated Methods. Fixes BUKKIT-798 and fixes BUKKIT-797
This commit is contained in:
parent
d7f6d2d929
commit
796d4a8a74
1 changed files with 2 additions and 20 deletions
|
@ -65,10 +65,6 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||||
perm.recalculatePermissions();
|
perm.recalculatePermissions();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isPlayer() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isOnline() {
|
public boolean isOnline() {
|
||||||
for (Object obj : server.getHandle().players) {
|
for (Object obj : server.getHandle().players) {
|
||||||
EntityPlayer player = (EntityPlayer) obj;
|
EntityPlayer player = (EntityPlayer) obj;
|
||||||
|
@ -486,20 +482,11 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||||
|
|
||||||
public void setExp(float exp) {
|
public void setExp(float exp) {
|
||||||
getHandle().exp = exp;
|
getHandle().exp = exp;
|
||||||
|
getHandle().lastSentExp = -1;
|
||||||
giveExp(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getExperience() {
|
|
||||||
return (int) (getExp() * 100);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setExperience(int exp) {
|
|
||||||
setExp(exp / 100);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getLevel() {
|
public int getLevel() {
|
||||||
return (int) getHandle().expLevel;
|
return getHandle().expLevel;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setLevel(int level) {
|
public void setLevel(int level) {
|
||||||
|
@ -513,11 +500,6 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||||
|
|
||||||
public void setTotalExperience(int exp) {
|
public void setTotalExperience(int exp) {
|
||||||
getHandle().expTotal = exp;
|
getHandle().expTotal = exp;
|
||||||
getHandle().lastSentExp = -1;
|
|
||||||
|
|
||||||
if (getTotalExperience() > getExperience()) {
|
|
||||||
getHandle().expTotal = getTotalExperience();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public float getExhaustion() {
|
public float getExhaustion() {
|
||||||
|
|
Loading…
Reference in a new issue