aboutsummaryrefslogtreecommitdiffhomepage
path: root/Spigot-Server-Patches-Unmapped/0135-Enforce-Sync-Player-Saves.patch
diff options
context:
space:
mode:
Diffstat (limited to 'Spigot-Server-Patches-Unmapped/0135-Enforce-Sync-Player-Saves.patch')
-rw-r--r--Spigot-Server-Patches-Unmapped/0135-Enforce-Sync-Player-Saves.patch26
1 files changed, 26 insertions, 0 deletions
diff --git a/Spigot-Server-Patches-Unmapped/0135-Enforce-Sync-Player-Saves.patch b/Spigot-Server-Patches-Unmapped/0135-Enforce-Sync-Player-Saves.patch
new file mode 100644
index 0000000000..cde18f2475
--- /dev/null
+++ b/Spigot-Server-Patches-Unmapped/0135-Enforce-Sync-Player-Saves.patch
@@ -0,0 +1,26 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Aikar <[email protected]>
+Date: Sat, 7 Jan 2017 15:41:58 -0500
+Subject: [PATCH] Enforce Sync Player Saves
+
+Saving players async is extremely dangerous. This will force it to main
+the same way we handle async chunk loads.
+
+diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
+index 95ff827b1d5704d279d258bdfb43fd33ec7a9187..d7cf89f4603779ce9a2e9a6f837a81684f209826 100644
+--- a/src/main/java/net/minecraft/server/players/PlayerList.java
++++ b/src/main/java/net/minecraft/server/players/PlayerList.java
+@@ -1047,11 +1047,13 @@ public abstract class PlayerList {
+ }
+
+ public void savePlayers() {
++ MCUtil.ensureMain("Save Players" , () -> { // Paper - Ensure main
+ MinecraftTimings.savePlayers.startTiming(); // Paper
+ for (int i = 0; i < this.players.size(); ++i) {
+ this.savePlayerFile((EntityPlayer) this.players.get(i));
+ }
+ MinecraftTimings.savePlayers.stopTiming(); // Paper
++ return null; }); // Paper - ensure main
+ }
+
+ public WhiteList getWhitelist() {