geforkt von Mirrors/Paper
62 Zeilen
3.9 KiB
Diff
62 Zeilen
3.9 KiB
Diff
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
|
|
index 929f59bce01c8e6ed4b0b551744d42e131b8fc80..22c4f8dea99f92a1eb3da2baf0a15bf9d2ca0462 100644
|
|
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedPlayerList.java
|
|
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedPlayerList.java
|
|
@@ -18,6 +18,11 @@ public class DedicatedPlayerList extends PlayerList {
|
|
this.setViewDistance(dedicatedServerProperties.viewDistance);
|
|
this.setSimulationDistance(dedicatedServerProperties.simulationDistance);
|
|
super.setUsingWhiteList(dedicatedServerProperties.whiteList.get());
|
|
+ // Paper start - fix converting txt to json file; moved from constructor
|
|
+ }
|
|
+ @Override
|
|
+ public void loadAndSaveFiles() {
|
|
+ // Paper end - fix converting txt to json file
|
|
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
|
|
index 20a3138c6c2a6c8ada8b6008913abae0eea76f2d..e95d592b6001dd4320c58133d841359f99c2d9c4 100644
|
|
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
|
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
|
@@ -215,6 +215,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
|
|
+ // Paper start - fix converting txt to json file; convert old users earlier after PlayerList creation but before file load/save
|
|
+ if (this.convertOldUsers()) {
|
|
+ this.getProfileCache().save(false); // Paper
|
|
+ }
|
|
+ this.getPlayerList().loadAndSaveFiles(); // Must be after convertNames
|
|
+ // Paper end - fix converting txt to json file
|
|
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
|
|
@@ -269,9 +275,6 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
|
DedicatedServer.LOGGER.warn("To change this, set \"online-mode\" to \"true\" in the server.properties file.");
|
|
}
|
|
|
|
- if (this.convertOldUsers()) {
|
|
- this.getProfileCache().save(false); // Paper - Perf: Async GameProfileCache saving
|
|
- }
|
|
|
|
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
|
|
index 7676dbe55b4bf6e0472dc0190c01e6ecfcbb464e..26e0414645f7ab11ca3e77c7c5e458612625aee9 100644
|
|
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
|
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
|
@@ -180,6 +180,7 @@ public abstract class PlayerList {
|
|
this.maxPlayers = maxPlayers;
|
|
this.playerIo = saveHandler;
|
|
}
|
|
+ abstract public void loadAndSaveFiles(); // Paper - fix converting txt to json file; moved from DedicatedPlayerList constructor
|
|
|
|
public void placeNewPlayer(Connection connection, ServerPlayer player, CommonListenerCookie clientData) {
|
|
player.isRealPlayer = true; // Paper
|