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
|
2023-09-22 19:59:56 +02:00
|
|
|
index a20d47f54f12dfc0a5f76dd969238e34c958b618..935dac757280731bfeb0a8f033cbe315ecac46da 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());
|
2021-06-11 14:02:28 +02:00
|
|
|
+ // Paper start - moved from constructor
|
|
|
|
+ }
|
|
|
|
+ @Override
|
|
|
|
+ public void loadAndSaveFiles() {
|
|
|
|
+ // Paper end
|
|
|
|
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
|
2023-11-19 01:29:14 +01:00
|
|
|
index 9e631002278e21f1e0a3989573e7d5b2e1a82dd8..4a088f998befc0f3e21f28da74bba14475b0e1c8 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
|
2022-12-07 21:16:54 +01:00
|
|
|
@@ -198,6 +198,12 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
2022-07-12 23:13:27 +02:00
|
|
|
io.papermc.paper.util.ObfHelper.INSTANCE.getClass(); // Paper - load mappings for stacktrace deobf and etc.
|
2023-11-19 01:29:14 +01:00
|
|
|
paperConfigurations.initializeGlobalConfiguration(this.registryAccess());
|
|
|
|
paperConfigurations.initializeWorldDefaultsConfiguration(this.registryAccess());
|
2021-06-11 14:02:28 +02:00
|
|
|
+ // Paper start - moved up to right after PlayerList creation but before file load/save
|
|
|
|
+ if (this.convertOldUsers()) {
|
|
|
|
+ this.getProfileCache().save(false); // Paper
|
|
|
|
+ }
|
|
|
|
+ this.getPlayerList().loadAndSaveFiles(); // Must be after convertNames
|
2022-07-12 23:13:27 +02:00
|
|
|
+ // Paper end - moved up
|
|
|
|
org.spigotmc.WatchdogThread.doStart(org.spigotmc.SpigotConfig.timeoutTime, org.spigotmc.SpigotConfig.restartOnCrash);
|
|
|
|
io.papermc.paper.command.PaperCommands.registerCommands(this);
|
|
|
|
com.destroystokyo.paper.Metrics.PaperMetrics.startMetrics();
|
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()) {
|
2021-06-15 04:59:31 +02:00
|
|
|
- this.getProfileCache().save(false); // Paper
|
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
|
2023-11-04 22:11:55 +01:00
|
|
|
index 705c0f7b601d025dfd7bbe1e69aec558f4bdb3f7..3cea14fa4a2f5346955c65864e24442c008ebcfa 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-09-22 07:41:27 +02:00
|
|
|
@@ -178,6 +178,7 @@ public abstract class PlayerList {
|
2021-06-11 14:02:28 +02:00
|
|
|
this.maxPlayers = maxPlayers;
|
|
|
|
this.playerIo = saveHandler;
|
|
|
|
}
|
|
|
|
+ abstract public void loadAndSaveFiles(); // Paper - moved from DedicatedPlayerList constructor
|
|
|
|
|
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
|