mirror of
https://github.com/BlueMap-Minecraft/BlueMap.git
synced 2024-11-22 10:35:16 +01:00
Actually, we should not rely on an exception here
This commit is contained in:
parent
6e123e1c3f
commit
aaeeeb136a
@ -222,8 +222,11 @@ public Chunk getChunk(Vector2i chunkPos) throws IOException {
|
||||
private Chunk loadChunk(Vector2i chunkPos) throws IOException {
|
||||
Vector2i regionPos = chunkToRegion(chunkPos);
|
||||
Path regionPath = getMCAFilePath(regionPos);
|
||||
|
||||
try (RandomAccessFile raf = new RandomAccessFile(regionPath.toFile(), "r")) {
|
||||
|
||||
File regionFile = regionPath.toFile();
|
||||
if (!regionFile.exists()) return Chunk.empty(this, chunkPos);
|
||||
|
||||
try (RandomAccessFile raf = new RandomAccessFile(regionFile, "r")) {
|
||||
|
||||
int xzChunk = Math.floorMod(chunkPos.getY(), 32) * 32 + Math.floorMod(chunkPos.getX(), 32);
|
||||
|
||||
@ -253,8 +256,6 @@ private Chunk loadChunk(Vector2i chunkPos) throws IOException {
|
||||
} else {
|
||||
throw new IOException("invalid data tag: " + (tag == null ? "null" : tag.getClass().getName()));
|
||||
}
|
||||
} catch (FileNotFoundException ex) {
|
||||
return Chunk.empty(this, chunkPos);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user