Paper/patches/server/0028-Check-online-mode-before-converting-and-renaming-pla.patch

20 lines
1.2 KiB
Diff
Raw Normal View History

2021-06-11 14:02:28 +02:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Zach Brown <zach.brown@destroystokyo.com>
Date: Wed, 2 Mar 2016 00:03:55 -0600
Subject: [PATCH] Check online mode before converting and renaming player data
diff --git a/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java b/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java
2021-06-12 00:37:16 +02:00
index 4dcdfda78966df2596b44f7e2d3b1d61c45f17af..7b367e273c2a6869f8d8929c24ee45efdf6d4b1e 100644
2021-06-11 14:02:28 +02:00
--- a/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java
+++ b/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java
@@ -56,7 +56,7 @@ public class PlayerDataStorage {
2021-06-12 00:37:16 +02:00
File file = new File(this.playerDir, player.getStringUUID() + ".dat");
2021-06-11 14:02:28 +02:00
// Spigot Start
boolean usingWrongFile = false;
- if ( !file.exists() )
+ if ( org.bukkit.Bukkit.getOnlineMode() && !file.exists() ) // Paper - Check online mode first
{
2021-06-12 00:37:16 +02:00
file = new File( this.playerDir, java.util.UUID.nameUUIDFromBytes( ( "OfflinePlayer:" + player.getScoreboardName() ).getBytes( "UTF-8" ) ).toString() + ".dat");
2021-06-11 14:02:28 +02:00
if ( file.exists() )