testserver/patches/server/0031-Check-online-mode-befo...

20 lines
1.2 KiB
Diff
Raw Normal View History

2021-06-11 12:02:28 +00: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
index 86fb11e9e197357871d603c4f8ce778660d507cf..0132eb685dbcf3d3402096bd34513e91d2b20abd 100644
2021-06-11 12:02:28 +00: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-11 22:37:16 +00:00
File file = new File(this.playerDir, player.getStringUUID() + ".dat");
2021-06-11 12:02:28 +00:00
// Spigot Start
boolean usingWrongFile = false;
- if ( !file.exists() )
+ if ( org.bukkit.Bukkit.getOnlineMode() && !file.exists() ) // Paper - Check online mode first
{
2021-06-11 22:37:16 +00:00
file = new File( this.playerDir, java.util.UUID.nameUUIDFromBytes( ( "OfflinePlayer:" + player.getScoreboardName() ).getBytes( "UTF-8" ) ).toString() + ".dat");
2021-06-11 12:02:28 +00:00
if ( file.exists() )