--- a/net/minecraft/world/level/storage/PlayerDataStorage.java
+++ b/net/minecraft/world/level/storage/PlayerDataStorage.java
@@ -33,6 +_,7 @@
     }
 
     public void save(Player player) {
+        if (org.spigotmc.SpigotConfig.disablePlayerDataSaving) return; // Spigot
         try (ProblemReporter.ScopedCollector scopedCollector = new ProblemReporter.ScopedCollector(player.problemPath(), LOGGER)) {
             TagValueOutput tagValueOutput = TagValueOutput.createWithContext(scopedCollector, player.registryAccess());
             player.saveWithoutId(tagValueOutput);
@@ -44,7 +_,7 @@
             Path path3 = path.resolve(player.getStringUUID() + ".dat_old");
             Util.safeReplaceFile(path2, path1, path3);
         } catch (Exception var11) {
-            LOGGER.warn("Failed to save player data for {}", player.getPlainTextName());
+            LOGGER.warn("Failed to save player data for {}", player.getPlainTextName(), var11); // Paper - Print exception
         }
     }
 
@@ -64,9 +_,25 @@
 
     private Optional<CompoundTag> load(NameAndId nameAndId, String suffix) {
         File file = new File(this.playerDir, nameAndId.id().toString() + suffix);
+        // Spigot start
+        boolean usingWrongFile = false;
+        if (org.bukkit.Bukkit.getOnlineMode() && !file.exists()) { // Paper - Check online mode first
+            file = new File(this.playerDir, net.minecraft.core.UUIDUtil.createOfflinePlayerUUID(nameAndId.name()) + suffix);
+            if (file.exists()) {
+                usingWrongFile = true;
+                LOGGER.warn("Using offline mode UUID file for player {} as it is the only copy we can find.", nameAndId.name());
+            }
+        }
+        // Spigot end
         if (file.exists() && file.isFile()) {
             try {
-                return Optional.of(NbtIo.readCompressed(file.toPath(), NbtAccounter.unlimitedHeap()));
+                // Spigot start
+                Optional<CompoundTag> optional = Optional.of(NbtIo.readCompressed(file.toPath(), NbtAccounter.unlimitedHeap()));
+                if (usingWrongFile) {
+                    file.renameTo(new File(file.getPath() + ".offline-read"));
+                }
+                return optional;
+                // Spigot end
             } catch (Exception var5) {
                 LOGGER.warn("Failed to load player data for {}", nameAndId.name());
             }
@@ -83,7 +_,13 @@
 
         return optional.or(() -> this.load(nameAndId, ".dat_old")).map(compoundTag -> {
             int dataVersion = NbtUtils.getDataVersion(compoundTag, -1);
-            return DataFixTypes.PLAYER.updateToCurrentVersion(this.fixerUpper, compoundTag, dataVersion);
+            return ca.spottedleaf.dataconverter.minecraft.MCDataConverter.convertTag(ca.spottedleaf.dataconverter.minecraft.datatypes.MCTypeRegistry.PLAYER, compoundTag, dataVersion, ca.spottedleaf.dataconverter.minecraft.util.Version.getCurrentVersion()); // Paper - rewrite data conversion system
         });
     }
+
+    // CraftBukkit start
+    public File getPlayerDir() {
+        return this.playerDir;
+    }
+    // CraftBukkit end
 }
