mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-16 12:43:52 -07:00
Implemented (offline)player date methods
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
@@ -12,6 +12,7 @@ import java.util.List;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import java.util.UUID; // CraftBukkit
|
||||
import org.bukkit.craftbukkit.entity.CraftPlayer; // CraftBukkit
|
||||
|
||||
public class WorldNBTStorage implements PlayerFileData, IDataManager {
|
||||
|
||||
@@ -202,6 +203,12 @@ public class WorldNBTStorage implements PlayerFileData, IDataManager {
|
||||
NBTTagCompound nbttagcompound = this.getPlayerData(entityhuman.name);
|
||||
|
||||
if (nbttagcompound != null) {
|
||||
// CraftBukkit start
|
||||
if (entityhuman instanceof EntityPlayer) {
|
||||
CraftPlayer player = (CraftPlayer)entityhuman.bukkitEntity;
|
||||
player.setFirstPlayed(new File(playerDir, entityhuman.name + ".dat").lastModified());
|
||||
}
|
||||
// CraftBukkit end
|
||||
entityhuman.e(nbttagcompound);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user