Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-11-16 13:00:06 +01:00
aa52bf9e33
Mojang made some changes to priorities in 1.17 and it seems that these changes conflict with the changes made in this patch, which in some cases appears to cause excessive rescheduling of tasks. This, however, is not confirmed as such but seems to be the behavior that we're seeing to cause this issue, if mojang has adopted the changes we suggested, then a good chunk of this patch may be unneeded, but, this needs a much better look than I'm currently able to do
62 Zeilen
3.4 KiB
Diff
62 Zeilen
3.4 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 aeb91eefa0949b2a53d77f1e4a48a29b9d1bc3fe..918f5221e94cbc867349c69c83563e225d2fef1d 100644
|
|
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedPlayerList.java
|
|
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedPlayerList.java
|
|
@@ -16,6 +16,11 @@ public class DedicatedPlayerList extends PlayerList {
|
|
DedicatedServerProperties dedicatedServerProperties = server.getProperties();
|
|
this.setViewDistance(dedicatedServerProperties.viewDistance);
|
|
super.setUsingWhiteList(dedicatedServerProperties.whiteList.get());
|
|
+ // 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
|
|
index 0a930147663850dc2ea7ffe9ced5611d5bab7c6d..41d1816543d0b98bd6a3ff5600cdd26257c7497a 100644
|
|
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
|
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
|
@@ -205,6 +205,12 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
|
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"));
|
|
@@ -266,9 +272,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
|
|
- }
|
|
|
|
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 9a7b635e2a962f4e1ae689ec7a3bc471d9d940cc..b26f03e163cbff2466f1ed0efd22c8e6059b7b00 100644
|
|
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
|
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
|
@@ -174,6 +174,7 @@ public abstract class PlayerList {
|
|
this.maxPlayers = maxPlayers;
|
|
this.playerIo = saveHandler;
|
|
}
|
|
+ abstract public void loadAndSaveFiles(); // Paper - moved from DedicatedPlayerList constructor
|
|
|
|
public void placeNewPlayer(Connection connection, ServerPlayer player) {
|
|
ServerPlayer prev = pendingPlayers.put(player.getUUID(), player);// Paper
|