--- a/net/minecraft/server/players/OldUsersConverter.java
+++ b/net/minecraft/server/players/OldUsersConverter.java
@@ -1,5 +1,6 @@
 package net.minecraft.server.players;
 
+import com.destroystokyo.paper.exception.ServerInternalException;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
 import com.google.common.io.Files;
@@ -14,6 +15,7 @@
 import java.text.ParseException;
 import java.util.Collection;
 import java.util.Date;
+import java.util.Iterator;
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
@@ -21,6 +23,8 @@
 import java.util.UUID;
 import javax.annotation.Nullable;
 import net.minecraft.core.UUIDUtil;
+import net.minecraft.nbt.CompoundTag;
+import net.minecraft.nbt.NbtIo;
 import net.minecraft.server.MinecraftServer;
 import net.minecraft.server.dedicated.DedicatedServer;
 import net.minecraft.util.StringUtil;
@@ -28,20 +32,27 @@
 import org.slf4j.Logger;
 
 public class OldUsersConverter {
+
     static final Logger LOGGER = LogUtils.getLogger();
     public static final File OLD_IPBANLIST = new File("banned-ips.txt");
     public static final File OLD_USERBANLIST = new File("banned-players.txt");
     public static final File OLD_OPLIST = new File("ops.txt");
     public static final File OLD_WHITELIST = new File("white-list.txt");
 
+    public OldUsersConverter() {}
+
     static List<String> readOldListFormat(File file, Map<String, String[]> valueMap) throws IOException {
         List<String> list = Files.readLines(file, StandardCharsets.UTF_8);
+        Iterator iterator = list.iterator();
 
-        for(String string : list) {
-            string = string.trim();
-            if (!string.startsWith("#") && string.length() >= 1) {
-                String[] strings = string.split("\\|");
-                valueMap.put(strings[0].toLowerCase(Locale.ROOT), strings);
+        while (iterator.hasNext()) {
+            String s = (String) iterator.next();
+
+            s = s.trim();
+            if (!s.startsWith("#") && s.length() >= 1) {
+                String[] astring = s.split("\\|");
+
+                valueMap.put(astring[0].toLowerCase(Locale.ROOT), astring);
             }
         }
 
@@ -49,69 +60,81 @@
     }
 
     private static void lookupPlayers(MinecraftServer server, Collection<String> bannedPlayers, ProfileLookupCallback callback) {
-        String[] strings = bannedPlayers.stream().filter((playerName) -> {
-            return !StringUtil.isNullOrEmpty(playerName);
+        String[] astring = (String[]) bannedPlayers.stream().filter((s) -> {
+            return !StringUtil.isNullOrEmpty(s);
         }).toArray((i) -> {
             return new String[i];
         });
-        if (server.usesAuthentication()) {
-            server.getProfileRepository().findProfilesByNames(strings, Agent.MINECRAFT, callback);
+
+        if (server.usesAuthentication()
+                || (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode())) { // Spigot: bungee = online mode, for now.  // Paper - Handle via setting
+            server.getProfileRepository().findProfilesByNames(astring, Agent.MINECRAFT, callback);
         } else {
-            for(String string : strings) {
-                UUID uUID = UUIDUtil.getOrCreatePlayerUUID(new GameProfile((UUID)null, string));
-                GameProfile gameProfile = new GameProfile(uUID, string);
-                callback.onProfileLookupSucceeded(gameProfile);
+            String[] astring1 = astring;
+            int i = astring.length;
+
+            for (int j = 0; j < i; ++j) {
+                String s = astring1[j];
+                UUID uuid = UUIDUtil.getOrCreatePlayerUUID(new GameProfile((UUID) null, s));
+                GameProfile gameprofile = new GameProfile(uuid, s);
+
+                callback.onProfileLookupSucceeded(gameprofile);
             }
         }
 
     }
 
     public static boolean convertUserBanlist(final MinecraftServer server) {
-        final UserBanList userBanList = new UserBanList(PlayerList.USERBANLIST_FILE);
-        if (OLD_USERBANLIST.exists() && OLD_USERBANLIST.isFile()) {
-            if (userBanList.getFile().exists()) {
+        final UserBanList gameprofilebanlist = new UserBanList(PlayerList.USERBANLIST_FILE);
+
+        if (OldUsersConverter.OLD_USERBANLIST.exists() && OldUsersConverter.OLD_USERBANLIST.isFile()) {
+            if (gameprofilebanlist.getFile().exists()) {
                 try {
-                    userBanList.load();
-                } catch (IOException var6) {
-                    LOGGER.warn("Could not load existing file {}", userBanList.getFile().getName(), var6);
+                    gameprofilebanlist.load();
+                } catch (IOException ioexception) {
+                    OldUsersConverter.LOGGER.warn("Could not load existing file {}", gameprofilebanlist.getFile().getName()); // CraftBukkit - don't print stacktrace
                 }
             }
 
             try {
                 final Map<String, String[]> map = Maps.newHashMap();
-                readOldListFormat(OLD_USERBANLIST, map);
-                ProfileLookupCallback profileLookupCallback = new ProfileLookupCallback() {
-                    public void onProfileLookupSucceeded(GameProfile gameProfile) {
-                        server.getProfileCache().add(gameProfile);
-                        String[] strings = map.get(gameProfile.getName().toLowerCase(Locale.ROOT));
-                        if (strings == null) {
-                            OldUsersConverter.LOGGER.warn("Could not convert user banlist entry for {}", (Object)gameProfile.getName());
+
+                OldUsersConverter.readOldListFormat(OldUsersConverter.OLD_USERBANLIST, map);
+                ProfileLookupCallback profilelookupcallback = new ProfileLookupCallback() {
+                    public void onProfileLookupSucceeded(GameProfile gameprofile) {
+                        server.getProfileCache().add(gameprofile);
+                        String[] astring = (String[]) map.get(gameprofile.getName().toLowerCase(Locale.ROOT));
+
+                        if (astring == null) {
+                            OldUsersConverter.LOGGER.warn("Could not convert user banlist entry for {}", gameprofile.getName());
                             throw new OldUsersConverter.ConversionError("Profile not in the conversionlist");
                         } else {
-                            Date date = strings.length > 1 ? OldUsersConverter.parseDate(strings[1], (Date)null) : null;
-                            String string = strings.length > 2 ? strings[2] : null;
-                            Date date2 = strings.length > 3 ? OldUsersConverter.parseDate(strings[3], (Date)null) : null;
-                            String string2 = strings.length > 4 ? strings[4] : null;
-                            userBanList.add(new UserBanListEntry(gameProfile, date, string, date2, string2));
+                            Date date = astring.length > 1 ? OldUsersConverter.parseDate(astring[1], (Date) null) : null;
+                            String s = astring.length > 2 ? astring[2] : null;
+                            Date date1 = astring.length > 3 ? OldUsersConverter.parseDate(astring[3], (Date) null) : null;
+                            String s1 = astring.length > 4 ? astring[4] : null;
+
+                            gameprofilebanlist.add(new UserBanListEntry(gameprofile, date, s, date1, s1));
                         }
                     }
 
-                    public void onProfileLookupFailed(GameProfile gameProfile, Exception exception) {
-                        OldUsersConverter.LOGGER.warn("Could not lookup user banlist entry for {}", gameProfile.getName(), exception);
+                    public void onProfileLookupFailed(GameProfile gameprofile, Exception exception) {
+                        OldUsersConverter.LOGGER.warn("Could not lookup user banlist entry for {}", gameprofile.getName(), exception);
                         if (!(exception instanceof ProfileNotFoundException)) {
-                            throw new OldUsersConverter.ConversionError("Could not request user " + gameProfile.getName() + " from backend systems", exception);
+                            throw new OldUsersConverter.ConversionError("Could not request user " + gameprofile.getName() + " from backend systems", exception);
                         }
                     }
                 };
-                lookupPlayers(server, map.keySet(), profileLookupCallback);
-                userBanList.save();
-                renameOldFile(OLD_USERBANLIST);
+
+                OldUsersConverter.lookupPlayers(server, map.keySet(), profilelookupcallback);
+                gameprofilebanlist.save();
+                OldUsersConverter.renameOldFile(OldUsersConverter.OLD_USERBANLIST);
                 return true;
-            } catch (IOException var4) {
-                LOGGER.warn("Could not read old user banlist to convert it!", (Throwable)var4);
+            } catch (IOException ioexception1) {
+                OldUsersConverter.LOGGER.warn("Could not read old user banlist to convert it!", ioexception1);
                 return false;
-            } catch (OldUsersConverter.ConversionError var5) {
-                LOGGER.error("Conversion failed, please try again later", (Throwable)var5);
+            } catch (OldUsersConverter.ConversionError namereferencingfileconverter_fileconversionexception) {
+                OldUsersConverter.LOGGER.error("Conversion failed, please try again later", namereferencingfileconverter_fileconversionexception);
                 return false;
             }
         } else {
@@ -120,34 +143,39 @@
     }
 
     public static boolean convertIpBanlist(MinecraftServer server) {
-        IpBanList ipBanList = new IpBanList(PlayerList.IPBANLIST_FILE);
-        if (OLD_IPBANLIST.exists() && OLD_IPBANLIST.isFile()) {
-            if (ipBanList.getFile().exists()) {
+        IpBanList ipbanlist = new IpBanList(PlayerList.IPBANLIST_FILE);
+
+        if (OldUsersConverter.OLD_IPBANLIST.exists() && OldUsersConverter.OLD_IPBANLIST.isFile()) {
+            if (ipbanlist.getFile().exists()) {
                 try {
-                    ipBanList.load();
-                } catch (IOException var11) {
-                    LOGGER.warn("Could not load existing file {}", ipBanList.getFile().getName(), var11);
+                    ipbanlist.load();
+                } catch (IOException ioexception) {
+                    OldUsersConverter.LOGGER.warn("Could not load existing file {}", ipbanlist.getFile().getName()); // CraftBukkit - don't print stacktrace
                 }
             }
 
             try {
                 Map<String, String[]> map = Maps.newHashMap();
-                readOldListFormat(OLD_IPBANLIST, map);
 
-                for(String string : map.keySet()) {
-                    String[] strings = map.get(string);
-                    Date date = strings.length > 1 ? parseDate(strings[1], (Date)null) : null;
-                    String string2 = strings.length > 2 ? strings[2] : null;
-                    Date date2 = strings.length > 3 ? parseDate(strings[3], (Date)null) : null;
-                    String string3 = strings.length > 4 ? strings[4] : null;
-                    ipBanList.add(new IpBanListEntry(string, date, string2, date2, string3));
+                OldUsersConverter.readOldListFormat(OldUsersConverter.OLD_IPBANLIST, map);
+                Iterator iterator = map.keySet().iterator();
+
+                while (iterator.hasNext()) {
+                    String s = (String) iterator.next();
+                    String[] astring = (String[]) map.get(s);
+                    Date date = astring.length > 1 ? OldUsersConverter.parseDate(astring[1], (Date) null) : null;
+                    String s1 = astring.length > 2 ? astring[2] : null;
+                    Date date1 = astring.length > 3 ? OldUsersConverter.parseDate(astring[3], (Date) null) : null;
+                    String s2 = astring.length > 4 ? astring[4] : null;
+
+                    ipbanlist.add(new IpBanListEntry(s, date, s1, date1, s2));
                 }
 
-                ipBanList.save();
-                renameOldFile(OLD_IPBANLIST);
+                ipbanlist.save();
+                OldUsersConverter.renameOldFile(OldUsersConverter.OLD_IPBANLIST);
                 return true;
-            } catch (IOException var10) {
-                LOGGER.warn("Could not parse old ip banlist to convert it!", (Throwable)var10);
+            } catch (IOException ioexception1) {
+                OldUsersConverter.LOGGER.warn("Could not parse old ip banlist to convert it!", ioexception1);
                 return false;
             }
         } else {
@@ -156,40 +184,42 @@
     }
 
     public static boolean convertOpsList(final MinecraftServer server) {
-        final ServerOpList serverOpList = new ServerOpList(PlayerList.OPLIST_FILE);
-        if (OLD_OPLIST.exists() && OLD_OPLIST.isFile()) {
-            if (serverOpList.getFile().exists()) {
+        final ServerOpList oplist = new ServerOpList(PlayerList.OPLIST_FILE);
+
+        if (OldUsersConverter.OLD_OPLIST.exists() && OldUsersConverter.OLD_OPLIST.isFile()) {
+            if (oplist.getFile().exists()) {
                 try {
-                    serverOpList.load();
-                } catch (IOException var6) {
-                    LOGGER.warn("Could not load existing file {}", serverOpList.getFile().getName(), var6);
+                    oplist.load();
+                } catch (IOException ioexception) {
+                    OldUsersConverter.LOGGER.warn("Could not load existing file {}", oplist.getFile().getName()); // CraftBukkit - don't print stacktrace
                 }
             }
 
             try {
-                List<String> list = Files.readLines(OLD_OPLIST, StandardCharsets.UTF_8);
-                ProfileLookupCallback profileLookupCallback = new ProfileLookupCallback() {
-                    public void onProfileLookupSucceeded(GameProfile gameProfile) {
-                        server.getProfileCache().add(gameProfile);
-                        serverOpList.add(new ServerOpListEntry(gameProfile, server.getOperatorUserPermissionLevel(), false));
+                List<String> list = Files.readLines(OldUsersConverter.OLD_OPLIST, StandardCharsets.UTF_8);
+                ProfileLookupCallback profilelookupcallback = new ProfileLookupCallback() {
+                    public void onProfileLookupSucceeded(GameProfile gameprofile) {
+                        server.getProfileCache().add(gameprofile);
+                        oplist.add(new ServerOpListEntry(gameprofile, server.getOperatorUserPermissionLevel(), false));
                     }
 
-                    public void onProfileLookupFailed(GameProfile gameProfile, Exception exception) {
-                        OldUsersConverter.LOGGER.warn("Could not lookup oplist entry for {}", gameProfile.getName(), exception);
+                    public void onProfileLookupFailed(GameProfile gameprofile, Exception exception) {
+                        OldUsersConverter.LOGGER.warn("Could not lookup oplist entry for {}", gameprofile.getName(), exception);
                         if (!(exception instanceof ProfileNotFoundException)) {
-                            throw new OldUsersConverter.ConversionError("Could not request user " + gameProfile.getName() + " from backend systems", exception);
+                            throw new OldUsersConverter.ConversionError("Could not request user " + gameprofile.getName() + " from backend systems", exception);
                         }
                     }
                 };
-                lookupPlayers(server, list, profileLookupCallback);
-                serverOpList.save();
-                renameOldFile(OLD_OPLIST);
+
+                OldUsersConverter.lookupPlayers(server, list, profilelookupcallback);
+                oplist.save();
+                OldUsersConverter.renameOldFile(OldUsersConverter.OLD_OPLIST);
                 return true;
-            } catch (IOException var4) {
-                LOGGER.warn("Could not read old oplist to convert it!", (Throwable)var4);
+            } catch (IOException ioexception1) {
+                OldUsersConverter.LOGGER.warn("Could not read old oplist to convert it!", ioexception1);
                 return false;
-            } catch (OldUsersConverter.ConversionError var5) {
-                LOGGER.error("Conversion failed, please try again later", (Throwable)var5);
+            } catch (OldUsersConverter.ConversionError namereferencingfileconverter_fileconversionexception) {
+                OldUsersConverter.LOGGER.error("Conversion failed, please try again later", namereferencingfileconverter_fileconversionexception);
                 return false;
             }
         } else {
@@ -198,40 +228,42 @@
     }
 
     public static boolean convertWhiteList(final MinecraftServer server) {
-        final UserWhiteList userWhiteList = new UserWhiteList(PlayerList.WHITELIST_FILE);
-        if (OLD_WHITELIST.exists() && OLD_WHITELIST.isFile()) {
-            if (userWhiteList.getFile().exists()) {
+        final UserWhiteList whitelist = new UserWhiteList(PlayerList.WHITELIST_FILE);
+
+        if (OldUsersConverter.OLD_WHITELIST.exists() && OldUsersConverter.OLD_WHITELIST.isFile()) {
+            if (whitelist.getFile().exists()) {
                 try {
-                    userWhiteList.load();
-                } catch (IOException var6) {
-                    LOGGER.warn("Could not load existing file {}", userWhiteList.getFile().getName(), var6);
+                    whitelist.load();
+                } catch (IOException ioexception) {
+                    OldUsersConverter.LOGGER.warn("Could not load existing file {}", whitelist.getFile().getName()); // CraftBukkit - don't print stacktrace
                 }
             }
 
             try {
-                List<String> list = Files.readLines(OLD_WHITELIST, StandardCharsets.UTF_8);
-                ProfileLookupCallback profileLookupCallback = new ProfileLookupCallback() {
-                    public void onProfileLookupSucceeded(GameProfile gameProfile) {
-                        server.getProfileCache().add(gameProfile);
-                        userWhiteList.add(new UserWhiteListEntry(gameProfile));
+                List<String> list = Files.readLines(OldUsersConverter.OLD_WHITELIST, StandardCharsets.UTF_8);
+                ProfileLookupCallback profilelookupcallback = new ProfileLookupCallback() {
+                    public void onProfileLookupSucceeded(GameProfile gameprofile) {
+                        server.getProfileCache().add(gameprofile);
+                        whitelist.add(new UserWhiteListEntry(gameprofile));
                     }
 
-                    public void onProfileLookupFailed(GameProfile gameProfile, Exception exception) {
-                        OldUsersConverter.LOGGER.warn("Could not lookup user whitelist entry for {}", gameProfile.getName(), exception);
+                    public void onProfileLookupFailed(GameProfile gameprofile, Exception exception) {
+                        OldUsersConverter.LOGGER.warn("Could not lookup user whitelist entry for {}", gameprofile.getName(), exception);
                         if (!(exception instanceof ProfileNotFoundException)) {
-                            throw new OldUsersConverter.ConversionError("Could not request user " + gameProfile.getName() + " from backend systems", exception);
+                            throw new OldUsersConverter.ConversionError("Could not request user " + gameprofile.getName() + " from backend systems", exception);
                         }
                     }
                 };
-                lookupPlayers(server, list, profileLookupCallback);
-                userWhiteList.save();
-                renameOldFile(OLD_WHITELIST);
+
+                OldUsersConverter.lookupPlayers(server, list, profilelookupcallback);
+                whitelist.save();
+                OldUsersConverter.renameOldFile(OldUsersConverter.OLD_WHITELIST);
                 return true;
-            } catch (IOException var4) {
-                LOGGER.warn("Could not read old whitelist to convert it!", (Throwable)var4);
+            } catch (IOException ioexception1) {
+                OldUsersConverter.LOGGER.warn("Could not read old whitelist to convert it!", ioexception1);
                 return false;
-            } catch (OldUsersConverter.ConversionError var5) {
-                LOGGER.error("Conversion failed, please try again later", (Throwable)var5);
+            } catch (OldUsersConverter.ConversionError namereferencingfileconverter_fileconversionexception) {
+                OldUsersConverter.LOGGER.error("Conversion failed, please try again later", namereferencingfileconverter_fileconversionexception);
                 return false;
             }
         } else {
@@ -243,105 +275,147 @@
     public static UUID convertMobOwnerIfNecessary(final MinecraftServer server, String name) {
         if (!StringUtil.isNullOrEmpty(name) && name.length() <= 16) {
             Optional<UUID> optional = server.getProfileCache().get(name).map(GameProfile::getId);
+
             if (optional.isPresent()) {
-                return optional.get();
+                return (UUID) optional.get();
             } else if (!server.isSingleplayer() && server.usesAuthentication()) {
                 final List<GameProfile> list = Lists.newArrayList();
-                ProfileLookupCallback profileLookupCallback = new ProfileLookupCallback() {
-                    public void onProfileLookupSucceeded(GameProfile gameProfile) {
-                        server.getProfileCache().add(gameProfile);
-                        list.add(gameProfile);
+                ProfileLookupCallback profilelookupcallback = new ProfileLookupCallback() {
+                    public void onProfileLookupSucceeded(GameProfile gameprofile) {
+                        server.getProfileCache().add(gameprofile);
+                        list.add(gameprofile);
                     }
 
-                    public void onProfileLookupFailed(GameProfile gameProfile, Exception exception) {
-                        OldUsersConverter.LOGGER.warn("Could not lookup user whitelist entry for {}", gameProfile.getName(), exception);
+                    public void onProfileLookupFailed(GameProfile gameprofile, Exception exception) {
+                        OldUsersConverter.LOGGER.warn("Could not lookup user whitelist entry for {}", gameprofile.getName(), exception);
                     }
                 };
-                lookupPlayers(server, Lists.newArrayList(name), profileLookupCallback);
-                return !list.isEmpty() && list.get(0).getId() != null ? list.get(0).getId() : null;
+
+                OldUsersConverter.lookupPlayers(server, Lists.newArrayList(new String[]{name}), profilelookupcallback);
+                return !list.isEmpty() && ((GameProfile) list.get(0)).getId() != null ? ((GameProfile) list.get(0)).getId() : null;
             } else {
-                return UUIDUtil.getOrCreatePlayerUUID(new GameProfile((UUID)null, name));
+                return UUIDUtil.getOrCreatePlayerUUID(new GameProfile((UUID) null, name));
             }
         } else {
             try {
                 return UUID.fromString(name);
-            } catch (IllegalArgumentException var5) {
+            } catch (IllegalArgumentException illegalargumentexception) {
                 return null;
             }
         }
     }
 
     public static boolean convertPlayers(final DedicatedServer minecraftServer) {
-        final File file = getWorldPlayersDirectory(minecraftServer);
-        final File file2 = new File(file.getParentFile(), "playerdata");
-        final File file3 = new File(file.getParentFile(), "unknownplayers");
+        final File file = OldUsersConverter.getWorldPlayersDirectory(minecraftServer);
+        final File file1 = new File(file.getParentFile(), "playerdata");
+        final File file2 = new File(file.getParentFile(), "unknownplayers");
+
         if (file.exists() && file.isDirectory()) {
-            File[] files = file.listFiles();
+            File[] afile = file.listFiles();
             List<String> list = Lists.newArrayList();
+            File[] afile1 = afile;
+            int i = afile.length;
 
-            for(File file4 : files) {
-                String string = file4.getName();
-                if (string.toLowerCase(Locale.ROOT).endsWith(".dat")) {
-                    String string2 = string.substring(0, string.length() - ".dat".length());
-                    if (!string2.isEmpty()) {
-                        list.add(string2);
+            for (int j = 0; j < i; ++j) {
+                File file3 = afile1[j];
+                String s = file3.getName();
+
+                if (s.toLowerCase(Locale.ROOT).endsWith(".dat")) {
+                    String s1 = s.substring(0, s.length() - ".dat".length());
+
+                    if (!s1.isEmpty()) {
+                        list.add(s1);
                     }
                 }
             }
 
             try {
-                final String[] strings = list.toArray(new String[list.size()]);
-                ProfileLookupCallback profileLookupCallback = new ProfileLookupCallback() {
-                    public void onProfileLookupSucceeded(GameProfile gameProfile) {
-                        minecraftServer.getProfileCache().add(gameProfile);
-                        UUID uUID = gameProfile.getId();
-                        if (uUID == null) {
-                            throw new OldUsersConverter.ConversionError("Missing UUID for user profile " + gameProfile.getName());
+                final String[] astring = (String[]) list.toArray(new String[list.size()]);
+                ProfileLookupCallback profilelookupcallback = new ProfileLookupCallback() {
+                    public void onProfileLookupSucceeded(GameProfile gameprofile) {
+                        minecraftServer.getProfileCache().add(gameprofile);
+                        UUID uuid = gameprofile.getId();
+
+                        if (uuid == null) {
+                            throw new OldUsersConverter.ConversionError("Missing UUID for user profile " + gameprofile.getName());
                         } else {
-                            this.movePlayerFile(file2, this.getFileNameForProfile(gameProfile), uUID.toString());
+                            this.movePlayerFile(file1, this.getFileNameForProfile(gameprofile), uuid.toString());
                         }
                     }
 
-                    public void onProfileLookupFailed(GameProfile gameProfile, Exception exception) {
-                        OldUsersConverter.LOGGER.warn("Could not lookup user uuid for {}", gameProfile.getName(), exception);
+                    public void onProfileLookupFailed(GameProfile gameprofile, Exception exception) {
+                        OldUsersConverter.LOGGER.warn("Could not lookup user uuid for {}", gameprofile.getName(), exception);
                         if (exception instanceof ProfileNotFoundException) {
-                            String string = this.getFileNameForProfile(gameProfile);
-                            this.movePlayerFile(file3, string, string);
+                            String s2 = this.getFileNameForProfile(gameprofile);
+
+                            this.movePlayerFile(file2, s2, s2);
                         } else {
-                            throw new OldUsersConverter.ConversionError("Could not request user " + gameProfile.getName() + " from backend systems", exception);
+                            throw new OldUsersConverter.ConversionError("Could not request user " + gameprofile.getName() + " from backend systems", exception);
                         }
                     }
 
                     private void movePlayerFile(File playerDataFolder, String fileName, String uuid) {
-                        File file = new File(file, fileName + ".dat");
-                        File file2 = new File(playerDataFolder, uuid + ".dat");
+                        File file5 = new File(file, fileName + ".dat");
+                        File file6 = new File(playerDataFolder, uuid + ".dat");
+
+                        // CraftBukkit start - Use old file name to seed lastKnownName
+                        CompoundTag root = null;
+
+                        try {
+                            root = NbtIo.readCompressed(new java.io.FileInputStream(file5));
+                        } catch (Exception exception) {
+                            io.papermc.paper.util.TraceUtil.printStackTrace(exception); // Paper
+                            ServerInternalException.reportInternalException(exception); // Paper
+                        }
+
+                        if (root != null) {
+                            if (!root.contains("bukkit")) {
+                                root.put("bukkit", new CompoundTag());
+                            }
+                            CompoundTag data = root.getCompound("bukkit");
+                            data.putString("lastKnownName", fileName);
+
+                            try {
+                                NbtIo.writeCompressed(root, new java.io.FileOutputStream(file2));
+                            } catch (Exception exception) {
+                                io.papermc.paper.util.TraceUtil.printStackTrace(exception); // Paper
+                                ServerInternalException.reportInternalException(exception); // Paper
+                            }
+                       }
+                        // CraftBukkit end
+
                         OldUsersConverter.ensureDirectoryExists(playerDataFolder);
-                        if (!file.renameTo(file2)) {
+                        if (!file5.renameTo(file6)) {
                             throw new OldUsersConverter.ConversionError("Could not convert file for " + fileName);
                         }
                     }
 
                     private String getFileNameForProfile(GameProfile profile) {
-                        String string = null;
+                        String s2 = null;
+                        String[] astring1 = astring;
+                        int k = astring1.length;
 
-                        for(String string2 : strings) {
-                            if (string2 != null && string2.equalsIgnoreCase(profile.getName())) {
-                                string = string2;
+                        for (int l = 0; l < k; ++l) {
+                            String s3 = astring1[l];
+
+                            if (s3 != null && s3.equalsIgnoreCase(profile.getName())) {
+                                s2 = s3;
                                 break;
                             }
                         }
 
-                        if (string == null) {
+                        if (s2 == null) {
                             throw new OldUsersConverter.ConversionError("Could not find the filename for " + profile.getName() + " anymore");
                         } else {
-                            return string;
+                            return s2;
                         }
                     }
                 };
-                lookupPlayers(minecraftServer, Lists.newArrayList(strings), profileLookupCallback);
+
+                OldUsersConverter.lookupPlayers(minecraftServer, Lists.newArrayList(astring), profilelookupcallback);
                 return true;
-            } catch (OldUsersConverter.ConversionError var12) {
-                LOGGER.error("Conversion failed, please try again later", (Throwable)var12);
+            } catch (OldUsersConverter.ConversionError namereferencingfileconverter_fileconversionexception) {
+                OldUsersConverter.LOGGER.error("Conversion failed, please try again later", namereferencingfileconverter_fileconversionexception);
                 return false;
             }
         } else {
@@ -360,50 +434,56 @@
     }
 
     public static boolean serverReadyAfterUserconversion(MinecraftServer server) {
-        boolean bl = areOldUserlistsRemoved();
-        return bl && areOldPlayersConverted(server);
+        boolean flag = OldUsersConverter.areOldUserlistsRemoved();
+
+        flag = flag && OldUsersConverter.areOldPlayersConverted(server);
+        return flag;
     }
 
     private static boolean areOldUserlistsRemoved() {
-        boolean bl = false;
-        if (OLD_USERBANLIST.exists() && OLD_USERBANLIST.isFile()) {
-            bl = true;
+        boolean flag = false;
+
+        if (OldUsersConverter.OLD_USERBANLIST.exists() && OldUsersConverter.OLD_USERBANLIST.isFile()) {
+            flag = true;
         }
 
-        boolean bl2 = false;
-        if (OLD_IPBANLIST.exists() && OLD_IPBANLIST.isFile()) {
-            bl2 = true;
+        boolean flag1 = false;
+
+        if (OldUsersConverter.OLD_IPBANLIST.exists() && OldUsersConverter.OLD_IPBANLIST.isFile()) {
+            flag1 = true;
         }
 
-        boolean bl3 = false;
-        if (OLD_OPLIST.exists() && OLD_OPLIST.isFile()) {
-            bl3 = true;
+        boolean flag2 = false;
+
+        if (OldUsersConverter.OLD_OPLIST.exists() && OldUsersConverter.OLD_OPLIST.isFile()) {
+            flag2 = true;
         }
 
-        boolean bl4 = false;
-        if (OLD_WHITELIST.exists() && OLD_WHITELIST.isFile()) {
-            bl4 = true;
+        boolean flag3 = false;
+
+        if (OldUsersConverter.OLD_WHITELIST.exists() && OldUsersConverter.OLD_WHITELIST.isFile()) {
+            flag3 = true;
         }
 
-        if (!bl && !bl2 && !bl3 && !bl4) {
+        if (!flag && !flag1 && !flag2 && !flag3) {
             return true;
         } else {
-            LOGGER.warn("**** FAILED TO START THE SERVER AFTER ACCOUNT CONVERSION!");
-            LOGGER.warn("** please remove the following files and restart the server:");
-            if (bl) {
-                LOGGER.warn("* {}", (Object)OLD_USERBANLIST.getName());
+            OldUsersConverter.LOGGER.warn("**** FAILED TO START THE SERVER AFTER ACCOUNT CONVERSION!");
+            OldUsersConverter.LOGGER.warn("** please remove the following files and restart the server:");
+            if (flag) {
+                OldUsersConverter.LOGGER.warn("* {}", OldUsersConverter.OLD_USERBANLIST.getName());
             }
 
-            if (bl2) {
-                LOGGER.warn("* {}", (Object)OLD_IPBANLIST.getName());
+            if (flag1) {
+                OldUsersConverter.LOGGER.warn("* {}", OldUsersConverter.OLD_IPBANLIST.getName());
             }
 
-            if (bl3) {
-                LOGGER.warn("* {}", (Object)OLD_OPLIST.getName());
+            if (flag2) {
+                OldUsersConverter.LOGGER.warn("* {}", OldUsersConverter.OLD_OPLIST.getName());
             }
 
-            if (bl4) {
-                LOGGER.warn("* {}", (Object)OLD_WHITELIST.getName());
+            if (flag3) {
+                OldUsersConverter.LOGGER.warn("* {}", OldUsersConverter.OLD_WHITELIST.getName());
             }
 
             return false;
@@ -411,14 +491,15 @@
     }
 
     private static boolean areOldPlayersConverted(MinecraftServer server) {
-        File file = getWorldPlayersDirectory(server);
-        if (!file.exists() || !file.isDirectory() || file.list().length <= 0 && file.delete()) {
-            return true;
-        } else {
-            LOGGER.warn("**** DETECTED OLD PLAYER DIRECTORY IN THE WORLD SAVE");
-            LOGGER.warn("**** THIS USUALLY HAPPENS WHEN THE AUTOMATIC CONVERSION FAILED IN SOME WAY");
-            LOGGER.warn("** please restart the server and if the problem persists, remove the directory '{}'", (Object)file.getPath());
+        File file = OldUsersConverter.getWorldPlayersDirectory(server);
+
+        if (file.exists() && file.isDirectory() && (file.list().length > 0 || !file.delete())) {
+            OldUsersConverter.LOGGER.warn("**** DETECTED OLD PLAYER DIRECTORY IN THE WORLD SAVE");
+            OldUsersConverter.LOGGER.warn("**** THIS USUALLY HAPPENS WHEN THE AUTOMATIC CONVERSION FAILED IN SOME WAY");
+            OldUsersConverter.LOGGER.warn("** please restart the server and if the problem persists, remove the directory '{}'", file.getPath());
             return false;
+        } else {
+            return true;
         }
     }
 
@@ -427,22 +508,25 @@
     }
 
     private static void renameOldFile(File file) {
-        File file2 = new File(file.getName() + ".converted");
-        file.renameTo(file2);
+        File file1 = new File(file.getName() + ".converted");
+
+        file.renameTo(file1);
     }
 
     static Date parseDate(String dateString, Date fallback) {
-        Date date;
+        Date date1;
+
         try {
-            date = BanListEntry.DATE_FORMAT.parse(dateString);
-        } catch (ParseException var4) {
-            date = fallback;
+            date1 = BanListEntry.DATE_FORMAT.parse(dateString);
+        } catch (ParseException parseexception) {
+            date1 = fallback;
         }
 
-        return date;
+        return date1;
     }
 
-    static class ConversionError extends RuntimeException {
+    private static class ConversionError extends RuntimeException {
+
         ConversionError(String message, Throwable cause) {
             super(message, cause);
         }
