Skip to content
This repository has been archived by the owner on Sep 20, 2021. It is now read-only.

Commit

Permalink
[v2.1.0-jv8]
Browse files Browse the repository at this point in the history
  • Loading branch information
yuttyann committed Feb 22, 2021
1 parent 9468102 commit 6d818e7
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import java.util.Map.Entry;

import com.github.yuttyann.scriptblockplus.BlockCoords;
import com.github.yuttyann.scriptblockplus.file.config.SBConfig;
import com.github.yuttyann.scriptblockplus.file.json.BaseJson;
import com.github.yuttyann.scriptblockplus.file.json.element.BlockScript;
import com.github.yuttyann.scriptblockplus.file.json.element.PlayerTimer;
Expand Down Expand Up @@ -205,7 +206,9 @@ private PlayerTimer createPlayerTimer(@NotNull Set<Entry<String, Object>> entrie
*/
private void saveFile(@NotNull File json, @NotNull List<?> list) throws IOException {
try (JsonWriter writer = new JsonWriter(FileUtils.newBufferedWriter(json))) {
writer.setIndent(BaseJson.INDENT);
if (list.size() < SBConfig.FORMAT_LIMIT.getValue()) {
writer.setIndent(BaseJson.INDENT);
}
GSON_HOLDER.getGson().toJson(list, list.getClass(), writer);
}
}
Expand Down

0 comments on commit 6d818e7

Please sign in to comment.