diff --git a/DynmapCore/src/main/java/org/dynmap/JsonFileClientUpdateComponent.java b/DynmapCore/src/main/java/org/dynmap/JsonFileClientUpdateComponent.java index c3a2f5b7..ceeac3a5 100644 --- a/DynmapCore/src/main/java/org/dynmap/JsonFileClientUpdateComponent.java +++ b/DynmapCore/src/main/java/org/dynmap/JsonFileClientUpdateComponent.java @@ -27,6 +27,7 @@ import org.json.simple.parser.ParseException; import static org.dynmap.JSONUtils.*; import java.nio.charset.Charset; +import java.util.concurrent.CompletableFuture; public class JsonFileClientUpdateComponent extends ClientUpdateComponent { protected long jsonInterval; @@ -338,9 +339,12 @@ public class JsonFileClientUpdateComponent extends ClientUpdateComponent { else { outputFile = "dynmap_" + dynmapWorld.getName() + ".json"; } - byte[] content = Json.stringifyJson(update).getBytes(cs_utf8); - enqueueFileWrite(outputFile, content, dowrap); + CompletableFuture.runAsync(() -> { + byte[] content = Json.stringifyJson(update).getBytes(cs_utf8); + + enqueueFileWrite(outputFile, content, dowrap); + }); } }