diff options
author | Kyle Wood <[email protected]> | 2021-04-24 17:01:33 -0500 |
---|---|---|
committer | Kyle Wood <[email protected]> | 2021-04-25 18:37:43 -0500 |
commit | 3093b81fee3064603c368ab934eddf66ce304433 (patch) | |
tree | cb99f05b5f31de92c41af4cc40b4bef5f3cbf573 /Spigot-Server-Patches-Unmapped/0135-Enforce-Sync-Player-Saves.patch | |
parent | 1af696a05d21cbdd7b5a7170f95598c013257588 (diff) | |
download | Paper-3093b81fee3064603c368ab934eddf66ce304433.tar.gz Paper-3093b81fee3064603c368ab934eddf66ce304433.zip |
Move patches
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.patch | 26 |
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() { |