2021-06-11 14:02:28 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Jake Potrebic <jake.m.potrebic@gmail.com>
|
|
|
|
Date: Mon, 4 Jan 2021 19:49:15 -0800
|
|
|
|
Subject: [PATCH] fix converting txt to json file
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedPlayerList.java b/src/main/java/net/minecraft/server/dedicated/DedicatedPlayerList.java
|
2024-01-19 22:13:42 +01:00
|
|
|
index a20d47f54f12dfc0a5f76dd969238e34c958b618..1c9cf5e1c4ee05724ffcdbd77a19bca1ab2be4d3 100644
|
2021-06-11 14:02:28 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedPlayerList.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedPlayerList.java
|
2022-12-07 21:16:54 +01:00
|
|
|
@@ -18,6 +18,11 @@ public class DedicatedPlayerList extends PlayerList {
|
2021-06-15 04:59:31 +02:00
|
|
|
this.setViewDistance(dedicatedServerProperties.viewDistance);
|
2021-11-24 21:15:19 +01:00
|
|
|
this.setSimulationDistance(dedicatedServerProperties.simulationDistance);
|
2021-06-15 04:59:31 +02:00
|
|
|
super.setUsingWhiteList(dedicatedServerProperties.whiteList.get());
|
2024-01-19 22:13:42 +01:00
|
|
|
+ // Paper start - fix converting txt to json file; moved from constructor
|
2021-06-11 14:02:28 +02:00
|
|
|
+ }
|
|
|
|
+ @Override
|
|
|
|
+ public void loadAndSaveFiles() {
|
2024-01-19 22:13:42 +01:00
|
|
|
+ // Paper end - fix converting txt to json file
|
2021-06-11 14:02:28 +02:00
|
|
|
this.loadUserBanList();
|
|
|
|
this.saveUserBanList();
|
|
|
|
this.loadIpBanList();
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
2024-01-24 15:57:53 +01:00
|
|
|
index 317f9048be060778104c8ac3494599c2141b7aac..413f2ab9b6df22f083df684a8a2e7e97a7a312a1 100644
|
2021-06-11 14:02:28 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
2024-01-13 21:31:02 +01:00
|
|
|
@@ -199,6 +199,12 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
|
|
|
this.paperConfigurations.initializeGlobalConfiguration(this.registryAccess());
|
|
|
|
this.paperConfigurations.initializeWorldDefaultsConfiguration(this.registryAccess());
|
|
|
|
// Paper end - initialize global and world-defaults configuration
|
2024-01-19 22:13:42 +01:00
|
|
|
+ // Paper start - fix converting txt to json file; convert old users earlier after PlayerList creation but before file load/save
|
2021-06-11 14:02:28 +02:00
|
|
|
+ if (this.convertOldUsers()) {
|
|
|
|
+ this.getProfileCache().save(false); // Paper
|
|
|
|
+ }
|
|
|
|
+ this.getPlayerList().loadAndSaveFiles(); // Must be after convertNames
|
2024-01-19 22:13:42 +01:00
|
|
|
+ // Paper end - fix converting txt to json file
|
2024-01-13 21:31:02 +01:00
|
|
|
org.spigotmc.WatchdogThread.doStart(org.spigotmc.SpigotConfig.timeoutTime, org.spigotmc.SpigotConfig.restartOnCrash); // Paper - start watchdog thread
|
|
|
|
io.papermc.paper.command.PaperCommands.registerCommands(this); // Paper - setup /paper command
|
|
|
|
com.destroystokyo.paper.Metrics.PaperMetrics.startMetrics(); // Paper - start metrics
|
2022-12-07 21:16:54 +01:00
|
|
|
@@ -253,9 +259,6 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
2021-06-11 14:02:28 +02:00
|
|
|
DedicatedServer.LOGGER.warn("To change this, set \"online-mode\" to \"true\" in the server.properties file.");
|
|
|
|
}
|
|
|
|
|
|
|
|
- if (this.convertOldUsers()) {
|
2024-01-23 14:34:17 +01:00
|
|
|
- this.getProfileCache().save(false); // Paper - Perf: Async GameProfileCache saving
|
2021-06-11 14:02:28 +02:00
|
|
|
- }
|
2021-06-15 04:59:31 +02:00
|
|
|
|
2021-06-11 14:02:28 +02:00
|
|
|
if (!OldUsersConverter.serverReadyAfterUserconversion(this)) {
|
|
|
|
return false;
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
2024-01-24 15:57:53 +01:00
|
|
|
index 065a189566d1eea08b1013ce64d1f2282d0c2dc3..fde0b21f3e3349cf55ed6e9c200cf0b63dcb11a9 100644
|
2021-06-11 14:02:28 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
2023-12-06 04:00:14 +01:00
|
|
|
@@ -176,6 +176,7 @@ public abstract class PlayerList {
|
2021-06-11 14:02:28 +02:00
|
|
|
this.maxPlayers = maxPlayers;
|
|
|
|
this.playerIo = saveHandler;
|
|
|
|
}
|
2024-01-19 22:13:42 +01:00
|
|
|
+ abstract public void loadAndSaveFiles(); // Paper - fix converting txt to json file; moved from DedicatedPlayerList constructor
|
2021-06-11 14:02:28 +02:00
|
|
|
|
2023-09-22 07:41:27 +02:00
|
|
|
public void placeNewPlayer(Connection connection, ServerPlayer player, CommonListenerCookie clientData) {
|
2022-09-26 10:02:51 +02:00
|
|
|
player.isRealPlayer = true; // Paper
|