summaryrefslogtreecommitdiffstats
path: root/src/main/java/net
diff options
context:
space:
mode:
authorNathan Adams <dinnerbone@dinnerbone.com>2012-01-14 18:08:27 +0000
committerNathan Adams <dinnerbone@dinnerbone.com>2012-01-14 18:08:27 +0000
commit2ab160e484fb064eed4c423ca8363a475a2da868 (patch)
tree764352d199976bd25a6e08bb1e35376e90539228 /src/main/java/net
parent548ccabe2f7612c604bdcde780eb694f04f50f7f (diff)
downloadcraftbukkit-2ab160e484fb064eed4c423ca8363a475a2da868.tar
craftbukkit-2ab160e484fb064eed4c423ca8363a475a2da868.tar.gz
craftbukkit-2ab160e484fb064eed4c423ca8363a475a2da868.tar.lz
craftbukkit-2ab160e484fb064eed4c423ca8363a475a2da868.tar.xz
craftbukkit-2ab160e484fb064eed4c423ca8363a475a2da868.zip
Implemented new PlayerDeathEvent methods for exp setting
Diffstat (limited to 'src/main/java/net')
-rw-r--r--src/main/java/net/minecraft/server/EntityPlayer.java22
1 files changed, 19 insertions, 3 deletions
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index 64821a6e..b9ca7d37 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -65,6 +65,9 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
public String listName;
public org.bukkit.Location compassTarget;
public int newExp = 0;
+ public int newLevel = 0;
+ public int newTotalExp = 0;
+ public boolean keepLevel = false;
// CraftBukkit end
public void a(NBTTagCompound nbttagcompound) {
@@ -553,6 +556,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
public void t_() {
this.cf = -99999999;
+ this.lastSentExp = -1; // CraftBukkit - Added to reset
}
public void a(String s) {
@@ -627,18 +631,30 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
}
public void reset() {
+ float exp = 0;
+ if(this.keepLevel) {
+ exp = this.exp;
+ this.newTotalExp = this.expTotal;
+ this.newLevel = this.expLevel;
+ }
+
this.health = 20;
this.fireTicks = 0;
this.fallDistance = 0;
this.foodData = new FoodMetaData();
- this.expLevel = 0;
- this.expTotal = 0;
+ this.expLevel = this.newLevel;
+ this.expTotal = this.newTotalExp;
this.exp = 0;
this.deathTicks = 0;
effects.clear();
this.activeContainer = this.defaultContainer;
this.lastSentExp = -1; // lastSentExp. Find line: "if (this.expTotal != this.XXXX) {"
- this.giveExp(this.newExp);
+ if(this.keepLevel) {
+ this.exp = exp;
+ } else {
+ this.giveExp(this.newExp);
+ }
+ this.keepLevel = false;
}
public CraftPlayer getPlayer() {