mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-11-23 18:55:14 +01:00
Stringify json for json file client async
This commit is contained in:
parent
66fe5d4a8b
commit
8ce85322dd
@ -27,6 +27,7 @@ import org.json.simple.parser.ParseException;
|
|||||||
import static org.dynmap.JSONUtils.*;
|
import static org.dynmap.JSONUtils.*;
|
||||||
|
|
||||||
import java.nio.charset.Charset;
|
import java.nio.charset.Charset;
|
||||||
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
|
||||||
public class JsonFileClientUpdateComponent extends ClientUpdateComponent {
|
public class JsonFileClientUpdateComponent extends ClientUpdateComponent {
|
||||||
protected long jsonInterval;
|
protected long jsonInterval;
|
||||||
@ -338,9 +339,12 @@ public class JsonFileClientUpdateComponent extends ClientUpdateComponent {
|
|||||||
else {
|
else {
|
||||||
outputFile = "dynmap_" + dynmapWorld.getName() + ".json";
|
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);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user