From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 16 May 2016 20:47:41 -0400 Subject: [PATCH] Async GameProfileCache saving diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java index f16ade2019e58a9374a550f58113313c118c2f2b..10d69b48158460e5739d1e41a83fcaeec819fac6 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -998,7 +998,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop { // Paper - Perf: Async GameProfileCache saving try { BufferedWriter bufferedwriter = Files.newWriter(this.file, StandardCharsets.UTF_8); @@ -294,6 +295,14 @@ public class GameProfileCache { } catch (IOException ioexception) { ; } + // Paper start - Perf: Async GameProfileCache saving + }; + if (asyncSave) { + io.papermc.paper.util.MCUtil.scheduleAsyncTask(save); + } else { + save.run(); + } + // Paper end - Perf: Async GameProfileCache saving }