Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-11-16 21:10:17 +01:00
Fix players losing experience when keepInventory is true. Fixes BUKKIT-2915
Dieser Commit ist enthalten in:
Ursprung
7ef9adc04e
Commit
cc78e17312
@ -764,7 +764,9 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
|||||||
|
|
||||||
public void reset() {
|
public void reset() {
|
||||||
float exp = 0;
|
float exp = 0;
|
||||||
if (this.keepLevel) {
|
boolean keepInventory = this.world.getGameRules().getBoolean("keepInventory");
|
||||||
|
|
||||||
|
if (this.keepLevel || keepInventory) {
|
||||||
exp = this.exp;
|
exp = this.exp;
|
||||||
this.newTotalExp = this.expTotal;
|
this.newTotalExp = this.expTotal;
|
||||||
this.newLevel = this.expLevel;
|
this.newLevel = this.expLevel;
|
||||||
@ -781,7 +783,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
|||||||
effects.clear();
|
effects.clear();
|
||||||
this.activeContainer = this.defaultContainer;
|
this.activeContainer = this.defaultContainer;
|
||||||
this.lastSentExp = -1;
|
this.lastSentExp = -1;
|
||||||
if (this.keepLevel) {
|
if (this.keepLevel || keepInventory) {
|
||||||
this.exp = exp;
|
this.exp = exp;
|
||||||
} else {
|
} else {
|
||||||
this.giveExp(this.newExp);
|
this.giveExp(this.newExp);
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren