diff options
Diffstat (limited to 'src/main/java/net/minecraft/server')
-rw-r--r-- | src/main/java/net/minecraft/server/EntityPlayer.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java index 06709f9b..85efb807 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -764,7 +764,9 @@ public class EntityPlayer extends EntityHuman implements ICrafting { public void reset() { float exp = 0; - if (this.keepLevel) { + boolean keepInventory = this.world.getGameRules().getBoolean("keepInventory"); + + if (this.keepLevel || keepInventory) { exp = this.exp; this.newTotalExp = this.expTotal; this.newLevel = this.expLevel; @@ -781,7 +783,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { effects.clear(); this.activeContainer = this.defaultContainer; this.lastSentExp = -1; - if (this.keepLevel) { + if (this.keepLevel || keepInventory) { this.exp = exp; } else { this.giveExp(this.newExp); |