Skip to content

Commit e5e770a

Browse files
committed
v1.4.0.1
1 parent 4869088 commit e5e770a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/main/java/me/byteful/plugin/leveltools/api/block/impl/FileBlockDataManager.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,12 @@ public FileBlockDataManager(Path file, Scheduler scheduler) {
2424
}
2525

2626
private void save() {
27-
final Set<String> lines = cache.stream().map(x -> String.format("{%s}{%s}{%s}%s", x.getX(), x.getY(), x.getZ(), x.getWorld())).collect(Collectors.toSet());
27+
final Set<String> lines;
28+
synchronized (cache) {
29+
lines = cache.stream()
30+
.map(x -> String.format("{%s}{%s}{%s}%s", x.getX(), x.getY(), x.getZ(), x.getWorld()))
31+
.collect(Collectors.toSet());
32+
}
2833

2934
try {
3035
Files.write(file, lines, StandardCharsets.UTF_8);

0 commit comments

Comments
 (0)