testserver/Spigot-Server-Patches/0027-Check-online-mode-befo...

23 lines
1.1 KiB
Diff

From 5b5459ca71a1bc441e5c57a852d70ecbdb24bd5d 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 caec56824..30b54a50e 100644
--- a/src/main/java/net/minecraft/server/WorldNBTStorage.java
+++ b/src/main/java/net/minecraft/server/WorldNBTStorage.java
@@ -167,7 +167,7 @@ public class WorldNBTStorage implements IDataManager, IPlayerFileData {
File file = new File(this.playerDir, entityhuman.bf() + ".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, UUID.nameUUIDFromBytes( ( "OfflinePlayer:" + entityhuman.getName() ).getBytes( "UTF-8" ) ).toString() + ".dat");
if ( file.exists() )
--
2.12.0.windows.1