diff options
author | Nathan Adams <dinnerbone@dinnerbone.com> | 2011-12-04 12:10:02 +0000 |
---|---|---|
committer | Nathan Adams <dinnerbone@dinnerbone.com> | 2011-12-04 12:10:02 +0000 |
commit | 98e062f0cf57299c9ae4c403e03f48751a32a0df (patch) | |
tree | 7dd2ea590319bac0310d36bb29a77b1c136c17a1 /src | |
parent | 55a532c2511a736c98b1be40b2c823d155096a05 (diff) | |
download | craftbukkit-98e062f0cf57299c9ae4c403e03f48751a32a0df.tar craftbukkit-98e062f0cf57299c9ae4c403e03f48751a32a0df.tar.gz craftbukkit-98e062f0cf57299c9ae4c403e03f48751a32a0df.tar.lz craftbukkit-98e062f0cf57299c9ae4c403e03f48751a32a0df.tar.xz craftbukkit-98e062f0cf57299c9ae4c403e03f48751a32a0df.zip |
Fixed a few player-respawn issues. This should resolve BUKKIT-28 (Dupe bug), BUKKIT-29 (Poisons lasting), and BUKKIT-46 (XP resetting)
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/net/minecraft/server/EntityPlayer.java | 15 | ||||
-rw-r--r-- | src/main/java/net/minecraft/server/ServerConfigurationManager.java | 10 |
2 files changed, 16 insertions, 9 deletions
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java index c23c5fa5..a84a6f4f 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -630,5 +630,20 @@ public class EntityPlayer extends EntityHuman implements ICrafting { public String toString() { return super.toString() + "(" + this.name + " at " + this.locX + "," + this.locY + "," + this.locZ + ")"; } + + public void reset() { + this.health = 20; + this.fireTicks = 0; + this.fallDistance = 0; + this.foodData = new FoodMetaData(); + this.expLevel = 0; + this.expTotal = 0; + this.exp = 0; + this.deathTicks = 0; + effects.clear(); + this.activeContainer = this.defaultContainer; + this.cf = -1; // lastSentExp. Find line: "if (this.expTotal != this.XXXX) {" + this.giveExp(this.newExp); + } // CraftBukkit end } diff --git a/src/main/java/net/minecraft/server/ServerConfigurationManager.java b/src/main/java/net/minecraft/server/ServerConfigurationManager.java index 4a0c61e7..ad1c702c 100644 --- a/src/main/java/net/minecraft/server/ServerConfigurationManager.java +++ b/src/main/java/net/minecraft/server/ServerConfigurationManager.java @@ -262,15 +262,7 @@ public class ServerConfigurationManager { this.cserver.getPluginManager().callEvent(respawnEvent); location = respawnEvent.getRespawnLocation(); - entityplayer.health = 20; - entityplayer.fireTicks = 0; - entityplayer.fallDistance = 0; - entityplayer.foodData = new FoodMetaData(); - entityplayer.expLevel = 0; - entityplayer.expTotal = 0; - entityplayer.exp = 0; - entityplayer.deathTicks = 0; - entityplayer.d(entityplayer.newExp); + entityplayer.reset(); } else { location.setWorld(this.server.getWorldServer(i).getWorld()); } |