diff options
author | Travis Watkins <amaranth@ubuntu.com> | 2013-03-13 17:33:27 -0500 |
---|---|---|
committer | Travis Watkins <amaranth@ubuntu.com> | 2013-03-15 13:28:59 -0500 |
commit | 83d29e461c85733f0113b6eb19db6e3b42da2949 (patch) | |
tree | b3063a1c28f478ab368d5ba3413a842def68c28f /src/main/java/net/minecraft/server/WorldNBTStorage.java | |
parent | ba6e4c38cfa98ad291974195cc46d70a4f138ac1 (diff) | |
download | craftbukkit-83d29e461c85733f0113b6eb19db6e3b42da2949.tar craftbukkit-83d29e461c85733f0113b6eb19db6e3b42da2949.tar.gz craftbukkit-83d29e461c85733f0113b6eb19db6e3b42da2949.tar.lz craftbukkit-83d29e461c85733f0113b6eb19db6e3b42da2949.tar.xz craftbukkit-83d29e461c85733f0113b6eb19db6e3b42da2949.zip |
Update CraftBukkit to Minecraft 1.5
Diffstat (limited to 'src/main/java/net/minecraft/server/WorldNBTStorage.java')
-rw-r--r-- | src/main/java/net/minecraft/server/WorldNBTStorage.java | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/main/java/net/minecraft/server/WorldNBTStorage.java b/src/main/java/net/minecraft/server/WorldNBTStorage.java index ddd979cc..e0ae71a8 100644 --- a/src/main/java/net/minecraft/server/WorldNBTStorage.java +++ b/src/main/java/net/minecraft/server/WorldNBTStorage.java @@ -16,14 +16,13 @@ import java.util.UUID; import org.bukkit.craftbukkit.entity.CraftPlayer; // CraftBukkit end -public class WorldNBTStorage implements IDataManager, PlayerFileData { +public class WorldNBTStorage implements IDataManager, IPlayerFileData { - private static final Logger log = Logger.getLogger("Minecraft"); private final File baseDir; private final File playerDir; private final File dataDir; private final long sessionId = System.currentTimeMillis(); - private final String f; + private final String e; private UUID uuid = null; // CraftBukkit public WorldNBTStorage(File file1, String s, boolean flag) { @@ -32,7 +31,7 @@ public class WorldNBTStorage implements IDataManager, PlayerFileData { this.playerDir = new File(this.baseDir, "players"); this.dataDir = new File(this.baseDir, "data"); this.dataDir.mkdirs(); - this.f = s; + this.e = s; if (flag) { this.playerDir.mkdirs(); } @@ -174,7 +173,7 @@ public class WorldNBTStorage implements IDataManager, PlayerFileData { try { NBTTagCompound nbttagcompound = new NBTTagCompound(); - entityhuman.d(nbttagcompound); + entityhuman.e(nbttagcompound); File file1 = new File(this.playerDir, entityhuman.name + ".dat.tmp"); File file2 = new File(this.playerDir, entityhuman.name + ".dat"); @@ -185,11 +184,11 @@ public class WorldNBTStorage implements IDataManager, PlayerFileData { file1.renameTo(file2); } catch (Exception exception) { - log.warning("Failed to save player data for " + entityhuman.name); + MinecraftServer.getServer().getLogger().warning("Failed to save player data for " + entityhuman.name); } } - public void load(EntityHuman entityhuman) { + public NBTTagCompound load(EntityHuman entityhuman) { NBTTagCompound nbttagcompound = this.getPlayerData(entityhuman.name); if (nbttagcompound != null) { @@ -199,8 +198,10 @@ public class WorldNBTStorage implements IDataManager, PlayerFileData { player.setFirstPlayed(new File(playerDir, entityhuman.name + ".dat").lastModified()); } // CraftBukkit end - entityhuman.e(nbttagcompound); + entityhuman.f(nbttagcompound); } + + return nbttagcompound; } public NBTTagCompound getPlayerData(String s) { @@ -211,13 +212,13 @@ public class WorldNBTStorage implements IDataManager, PlayerFileData { return NBTCompressedStreamTools.a((InputStream) (new FileInputStream(file1))); } } catch (Exception exception) { - log.warning("Failed to load player data for " + s); + MinecraftServer.getServer().getLogger().warning("Failed to load player data for " + s); } return null; } - public PlayerFileData getPlayerFileData() { + public IPlayerFileData getPlayerFileData() { return this; } @@ -240,7 +241,7 @@ public class WorldNBTStorage implements IDataManager, PlayerFileData { } public String g() { - return this.f; + return this.e; } // CraftBukkit start |