diff options
author | Thinkofdeath <thinkofdeath@spigotmc.org> | 2014-11-26 08:32:16 +1100 |
---|---|---|
committer | md_5 <git@md-5.net> | 2014-11-28 17:16:30 +1100 |
commit | 24557bc2b37deb6a0edf497d547471832457b1dd (patch) | |
tree | c560572889a3b0b34964a0cddb35dc87fda3c914 /src/main/java/net/minecraft/server/PlayerDatFileConverter.java | |
parent | a4805dbd77da057cc1ea0bf344379bc6e53ca1f6 (diff) | |
download | craftbukkit-24557bc2b37deb6a0edf497d547471832457b1dd.tar craftbukkit-24557bc2b37deb6a0edf497d547471832457b1dd.tar.gz craftbukkit-24557bc2b37deb6a0edf497d547471832457b1dd.tar.lz craftbukkit-24557bc2b37deb6a0edf497d547471832457b1dd.tar.xz craftbukkit-24557bc2b37deb6a0edf497d547471832457b1dd.zip |
Update to Minecraft 1.8
For more information please see http://www.spigotmc.org/
Diffstat (limited to 'src/main/java/net/minecraft/server/PlayerDatFileConverter.java')
-rw-r--r-- | src/main/java/net/minecraft/server/PlayerDatFileConverter.java | 98 |
1 files changed, 0 insertions, 98 deletions
diff --git a/src/main/java/net/minecraft/server/PlayerDatFileConverter.java b/src/main/java/net/minecraft/server/PlayerDatFileConverter.java deleted file mode 100644 index 27651b5a..00000000 --- a/src/main/java/net/minecraft/server/PlayerDatFileConverter.java +++ /dev/null @@ -1,98 +0,0 @@ -package net.minecraft.server; - -import java.io.File; -import java.util.UUID; - -import net.minecraft.util.com.mojang.authlib.GameProfile; -import net.minecraft.util.com.mojang.authlib.ProfileLookupCallback; -import net.minecraft.util.com.mojang.authlib.yggdrasil.ProfileNotFoundException; - -final class PlayerDatFileConverter implements ProfileLookupCallback { - - final DedicatedServer a; - final File b; - final File c; - final File d; - final String[] e; - - PlayerDatFileConverter(DedicatedServer dedicatedserver, File file1, File file2, File file3, String[] astring) { - this.a = dedicatedserver; - this.b = file1; - this.c = file2; - this.d = file3; - this.e = astring; - } - - public void onProfileLookupSucceeded(GameProfile gameprofile) { - this.a.getUserCache().a(gameprofile); - UUID uuid = gameprofile.getId(); - - if (uuid == null) { - throw new FileConversionException("Missing UUID for user profile " + gameprofile.getName(), (PredicateEmptyList) null); - } else { - this.a(this.b, this.a(gameprofile), uuid.toString()); - } - } - - public void onProfileLookupFailed(GameProfile gameprofile, Exception exception) { - NameReferencingFileConverter.a().warn("Could not lookup user uuid for " + gameprofile.getName(), exception); - if (exception instanceof ProfileNotFoundException) { - String s = this.a(gameprofile); - - this.a(this.c, s, s); - } else { - throw new FileConversionException("Could not request user " + gameprofile.getName() + " from backend systems", exception, (PredicateEmptyList) null); - } - } - - private void a(File file1, String s, String s1) { - File file2 = new File(this.d, s + ".dat"); - File file3 = new File(file1, s1 + ".dat"); - - // CraftBukkit start - Use old file name to seed lastKnownName - NBTTagCompound root = null; - - try { - root = NBTCompressedStreamTools.a(new java.io.FileInputStream(file2)); - } catch (Exception exception) { - exception.printStackTrace(); - } - - if (root != null) { - if (!root.hasKey("bukkit")) { - root.set("bukkit", new NBTTagCompound()); - } - NBTTagCompound data = root.getCompound("bukkit"); - data.setString("lastKnownName", s); - - try { - NBTCompressedStreamTools.a(root, new java.io.FileOutputStream(file2)); - } catch (Exception exception) { - exception.printStackTrace(); - } - } - // CraftBukkit end - - NameReferencingFileConverter.a(file1); - if (!file2.renameTo(file3)) { - throw new FileConversionException("Could not convert file for " + s, (PredicateEmptyList) null); - } - } - - private String a(GameProfile gameprofile) { - String s = null; - - for (int i = 0; i < this.e.length; ++i) { - if (this.e[i] != null && this.e[i].equalsIgnoreCase(gameprofile.getName())) { - s = this.e[i]; - break; - } - } - - if (s == null) { - throw new FileConversionException("Could not find the filename for " + gameprofile.getName() + " anymore", (PredicateEmptyList) null); - } else { - return s; - } - } -} |