aboutsummaryrefslogtreecommitdiffhomepage
path: root/Spigot-Server-Patches/0028-Check-online-mode-before-converting-and-renaming-pla.patch
blob: d9176841a6adb65c5bd328383cc1232d253f7488 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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/server/WorldNBTStorage.java b/src/main/java/net/minecraft/server/WorldNBTStorage.java
index 240f9331dca65990f5e724b88050342831868e72..ef9719bf20db92a7e6690bccb00cc54293d392a9 100644
--- a/src/main/java/net/minecraft/server/WorldNBTStorage.java
+++ b/src/main/java/net/minecraft/server/WorldNBTStorage.java
@@ -50,7 +50,7 @@ public class WorldNBTStorage {
             File file = new File(this.playerDir, entityhuman.getUniqueIDString() + ".dat");
             // Spigot Start
             boolean usingWrongFile = false;
-            if ( !file.exists() )
+            if ( org.bukkit.Bukkit.getOnlineMode() && !file.exists() ) // Paper - Check online mode first
             {
                 file = new File( this.playerDir, java.util.UUID.nameUUIDFromBytes( ( "OfflinePlayer:" + entityhuman.getName() ).getBytes( "UTF-8" ) ).toString() + ".dat");
                 if ( file.exists() )