mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-30 04:02:50 +01:00
Fixed clients not seeing EXP update immediately after using .setTotalExp and level methods
This commit is contained in:
parent
bd181fa04e
commit
52faa415ef
1 changed files with 2 additions and 0 deletions
|
@ -497,6 +497,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
|||
|
||||
public void setLevel(int level) {
|
||||
getHandle().expLevel = level;
|
||||
getHandle().cf = -1;
|
||||
}
|
||||
|
||||
public int getTotalExperience() {
|
||||
|
@ -505,6 +506,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
|||
|
||||
public void setTotalExperience(int exp) {
|
||||
getHandle().expTotal = exp;
|
||||
getHandle().cf = -1;
|
||||
|
||||
if (getTotalExperience() > getExperience()) {
|
||||
getHandle().expTotal = getTotalExperience();
|
||||
|
|
Loading…
Reference in a new issue