Implemented (offline)player date methods

This commit is contained in:
Nathan Adams
2011-12-12 17:39:52 +00:00
parent 91ff0b059d
commit b653ce3c1c
4 changed files with 127 additions and 1 deletions

View File

@@ -9,9 +9,9 @@ import java.util.Set;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.ChunkCompressionThread;
import org.bukkit.craftbukkit.CraftWorld;
import org.bukkit.craftbukkit.entity.CraftPlayer;
import org.bukkit.craftbukkit.event.CraftEventFactory;
import org.bukkit.craftbukkit.inventory.CraftItemStack;
import org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason;
import org.bukkit.event.entity.PlayerDeathEvent;
// CraftBukkit end
@@ -72,11 +72,13 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
if (nbttagcompound.hasKey("playerGameType")) {
this.itemInWorldManager.a(nbttagcompound.getInt("playerGameType"));
}
getPlayer().readExtraData(nbttagcompound); // CraftBukkit
}
public void b(NBTTagCompound nbttagcompound) {
super.b(nbttagcompound);
nbttagcompound.setInt("playerGameType", this.itemInWorldManager.a());
getPlayer().setExtraData(nbttagcompound); // CraftBukkit
}
public void spawnIn(World world) {
@@ -647,5 +649,9 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
this.cf = -1; // lastSentExp. Find line: "if (this.expTotal != this.XXXX) {"
this.giveExp(this.newExp);
}
public CraftPlayer getPlayer() {
return (CraftPlayer)getBukkitEntity();
}
// CraftBukkit end
}