Yeah this would fully solve the issue of chunk unloading race condition The same fix was already initially added at "Force clamp grid-exponent to 1~6"
55 lines
2.8 KiB
Diff
55 lines
2.8 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
|
|
Date: Sun, 28 Jun 2026 20:51:53 +0800
|
|
Subject: [PATCH] Leaf: Remove useless creating stats json bases on player name
|
|
logic
|
|
|
|
Co-authored by: Dreeam <61569423+Dreeam-qwq@users.noreply.github.com>
|
|
As part of: Leaf (https://github.com/Winds-Studio/Leaf/blob/7f3e240bbe0970683c40279a7a65f0fde47503b6/leaf-server/minecraft-patches/features/0043-Remove-useless-creating-stats-json-bases-on-player-n.patch)
|
|
Licensed under: MIT (https://github.com/Winds-Studio/Leaf/blob/7f3e240bbe0970683c40279a7a65f0fde47503b6/licenses/MIT.txt)
|
|
|
|
diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java
|
|
index fcfa2b7b6e8f4c00763b8c23d6eb2699aced3e75..7ee90d4a8d333c253077871cede3fed63ef23539 100644
|
|
--- a/net/minecraft/server/players/PlayerList.java
|
|
+++ b/net/minecraft/server/players/PlayerList.java
|
|
@@ -1294,22 +1294,26 @@ public abstract class PlayerList {
|
|
Path uuidStatsFile = statFolder.resolve(gameProfile.id() + ".json");
|
|
if (Files.exists(uuidStatsFile)) {
|
|
return uuidStatsFile;
|
|
- }
|
|
-
|
|
- String playerNameStatsFile = gameProfile.name() + ".json";
|
|
- if (FileUtil.isValidPathSegment(playerNameStatsFile)) {
|
|
- Path playerNameStatsPath = statFolder.resolve(playerNameStatsFile);
|
|
- if (Files.isRegularFile(playerNameStatsPath)) {
|
|
- try {
|
|
- return Files.move(playerNameStatsPath, uuidStatsFile);
|
|
- } catch (IOException e) {
|
|
- LOGGER.warn("Failed to copy file {} to {}", playerNameStatsFile, uuidStatsFile);
|
|
- return playerNameStatsPath;
|
|
+ } else {
|
|
+ // Leaf start - Remove useless creating stats json bases on player name logic
|
|
+ /*
|
|
+ String playerNameStatsFile = gameProfile.name() + ".json";
|
|
+ if (FileUtil.isValidPathSegment(playerNameStatsFile)) {
|
|
+ Path playerNameStatsPath = statFolder.resolve(playerNameStatsFile);
|
|
+ if (Files.isRegularFile(playerNameStatsPath)) {
|
|
+ try {
|
|
+ return Files.move(playerNameStatsPath, uuidStatsFile);
|
|
+ } catch (IOException e) {
|
|
+ LOGGER.warn("Failed to copy file {} to {}", playerNameStatsFile, uuidStatsFile);
|
|
+ return playerNameStatsPath;
|
|
+ }
|
|
}
|
|
}
|
|
- }
|
|
+ */
|
|
+ // Leaf end - Remove useless creating stats json bases on player name logic
|
|
|
|
- return uuidStatsFile;
|
|
+ return uuidStatsFile;
|
|
+ }
|
|
}
|
|
|
|
public PlayerAdvancements getPlayerAdvancements(final ServerPlayer player) {
|