2021-06-11 12:02:28 +00: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
|
2021-06-15 02:59:31 +00:00
|
|
|
index aeb91eefa0949b2a53d77f1e4a48a29b9d1bc3fe..918f5221e94cbc867349c69c83563e225d2fef1d 100644
|
2021-06-11 12:02:28 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedPlayerList.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedPlayerList.java
|
2021-06-15 02:59:31 +00:00
|
|
|
@@ -16,6 +16,11 @@ public class DedicatedPlayerList extends PlayerList {
|
|
|
|
DedicatedServerProperties dedicatedServerProperties = server.getProperties();
|
|
|
|
this.setViewDistance(dedicatedServerProperties.viewDistance);
|
|
|
|
super.setUsingWhiteList(dedicatedServerProperties.whiteList.get());
|
2021-06-11 12:02:28 +00: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
|
2021-09-09 16:57:16 +00:00
|
|
|
index 286863b7eb9ee0389154304e61942dd68f978ff1..67afb97e6cb545d319202f3eca771015065089f6 100644
|
2021-06-11 12:02:28 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
2021-07-07 06:52:40 +00:00
|
|
|
@@ -205,6 +205,12 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
2021-06-11 12:02:28 +00:00
|
|
|
org.spigotmc.SpigotConfig.init((java.io.File) options.valueOf("spigot-settings"));
|
|
|
|
org.spigotmc.SpigotConfig.registerCommands();
|
|
|
|
// Spigot end
|
|
|
|
+ // 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
|
|
|
|
+ // Paper end
|
|
|
|
// Paper start
|
|
|
|
try {
|
|
|
|
com.destroystokyo.paper.PaperConfig.init((java.io.File) options.valueOf("paper-settings"));
|
2021-09-09 16:57:16 +00:00
|
|
|
@@ -267,9 +273,6 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
2021-06-11 12:02:28 +00:00
|
|
|
DedicatedServer.LOGGER.warn("To change this, set \"online-mode\" to \"true\" in the server.properties file.");
|
|
|
|
}
|
|
|
|
|
|
|
|
- if (this.convertOldUsers()) {
|
2021-06-15 02:59:31 +00:00
|
|
|
- this.getProfileCache().save(false); // Paper
|
2021-06-11 12:02:28 +00:00
|
|
|
- }
|
2021-06-15 02:59:31 +00:00
|
|
|
|
2021-06-11 12:02:28 +00: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
|
2021-08-26 02:16:27 +00:00
|
|
|
index 4662c7461a9d9a7f7989003ec00d4bd97a549bde..cad35d9c45513b7db7714b7dd294cf0445b4908c 100644
|
2021-06-11 12:02:28 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
2021-07-07 06:52:40 +00:00
|
|
|
@@ -174,6 +174,7 @@ public abstract class PlayerList {
|
2021-06-11 12:02:28 +00:00
|
|
|
this.maxPlayers = maxPlayers;
|
|
|
|
this.playerIo = saveHandler;
|
|
|
|
}
|
|
|
|
+ abstract public void loadAndSaveFiles(); // Paper - moved from DedicatedPlayerList constructor
|
|
|
|
|
|
|
|
public void placeNewPlayer(Connection connection, ServerPlayer player) {
|
2021-08-26 02:16:27 +00:00
|
|
|
player.isRealPlayer = true; // Paper - Chunk priority
|