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 b15e37b0e9
commit 52496b075b

View file

@ -260,6 +260,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
throw new RuntimeException("Error generating crash report", t);
}
// Spigot End
@@ -0,0 +0,0 @@ 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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java