Fix Reloadable save players error on stop

Not sure what plugins or panels are doing to have triggered this.
Reloading resource packs appear to have been happening during shutdown

So this will abort the end of the reload process if we are not on the
correct thread and stop saving players as part of this task too.
This commit is contained in:
Aikar 2020-06-28 20:06:26 -04:00
parent bcc619ae1e
commit 35282e46fa
No known key found for this signature in database
GPG Key ID: 401ADFC9891FAAFE
1 changed files with 11 additions and 1 deletions

View File

@ -109,7 +109,7 @@ index 63fdae15ccbef0c39718b320dbd096794bcfa3b4..6beefff203ed6e448898eb5b2e95800d
}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 5bef465bfe90b08524862b13f9e22dcf9e3438cd..57f7dfc6a5316cfec5cce9c60e7b91d94c505f50 100644
index 5bef465bfe90b08524862b13f9e22dcf9e3438cd..38a8719dcc54fe3f8e0e47854df15a202f47bab2 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -159,7 +159,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
@ -260,6 +260,16 @@ index 5bef465bfe90b08524862b13f9e22dcf9e3438cd..57f7dfc6a5316cfec5cce9c60e7b91d9
throw new RuntimeException("Error generating crash report", t);
}
// Spigot End
@@ -1756,7 +1808,8 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
this.resourcePackRepository.a(collection);
this.saveData.a(a(this.resourcePackRepository));
datapackresources.i();
- this.getPlayerList().savePlayers();
+ if (Thread.currentThread() != this.serverThread) return; // Paper
+ //this.getPlayerList().savePlayers(); // Paper - we don't need to do this
this.getPlayerList().reload();
this.customFunctionData.a(this.dataPackResources.a());
this.ak.a(this.dataPackResources.h());
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
index bb4d54ebee573964cf3026888da108584b12972f..09f94bd242318155dbb46e12224ad3e47eed40cf 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java