Paper/patches/server/0036-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
2023-06-07 20:31:32 +02:00
index e2c0ab0ab06b15dcfa6ce8c82ad4136f2be33b5c..984b75e12b5feab63767e030df925b3cbf26d559 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() )