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

Commit 6d818e7

Browse files
committed
[v2.1.0-jv8]
1 parent 9468102 commit 6d818e7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/main/java/com/github/yuttyann/scriptblockplus/file/json/legacy/LegacyFormatJson.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import java.util.Map.Entry;
2727

2828
import com.github.yuttyann.scriptblockplus.BlockCoords;
29+
import com.github.yuttyann.scriptblockplus.file.config.SBConfig;
2930
import com.github.yuttyann.scriptblockplus.file.json.BaseJson;
3031
import com.github.yuttyann.scriptblockplus.file.json.element.BlockScript;
3132
import com.github.yuttyann.scriptblockplus.file.json.element.PlayerTimer;
@@ -205,7 +206,9 @@ private PlayerTimer createPlayerTimer(@NotNull Set<Entry<String, Object>> entrie
205206
*/
206207
private void saveFile(@NotNull File json, @NotNull List<?> list) throws IOException {
207208
try (JsonWriter writer = new JsonWriter(FileUtils.newBufferedWriter(json))) {
208-
writer.setIndent(BaseJson.INDENT);
209+
if (list.size() < SBConfig.FORMAT_LIMIT.getValue()) {
210+
writer.setIndent(BaseJson.INDENT);
211+
}
209212
GSON_HOLDER.getGson().toJson(list, list.getClass(), writer);
210213
}
211214
}

0 commit comments

Comments
 (0)