Skip to content

Commit ae87abc

Browse files
committed
file issues
1 parent 1342465 commit ae87abc

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
org.gradle.jvmargs = -Xmx1G
22
org.gradle.parallel = true
33

4-
version = b12.0.2
4+
version = b12.0.3
55
maven_group = net.ludocrypt
66
archives_base_name = limlib

src/main/java/net/ludocrypt/limlib/api/world/maze/storage/MazeStorage.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import java.util.LinkedList;
66
import java.util.Map;
77
import java.util.Map.Entry;
8-
import java.util.Optional;
98
import java.util.Queue;
109

1110
import org.apache.commons.io.FilenameUtils;
@@ -93,7 +92,11 @@ public void serialize(String mazeId, Vec2i pos, MazeComponent maze) {
9392
File regionFile = new File(new File(dir, mazeId), "m." + ((pos.getX() - MathHelper
9493
.floorMod(pos.getX(), 16)) / 16) + "." + ((pos.getY() - MathHelper.floorMod(pos.getY(), 16)) / 16) + ".nbt");
9594

96-
NbtCompound region = Optional.ofNullable(NbtIo.readCompressed(regionFile)).orElse(new NbtCompound());
95+
NbtCompound region = new NbtCompound();
96+
97+
if (regionFile.exists()) {
98+
region = NbtIo.readCompressed(regionFile);
99+
}
97100

98101
NbtCompound compound = new NbtCompound();
99102
NbtCompound mazeCompound = maze.write(new NbtCompound());

0 commit comments

Comments
 (0)