mirror of
https://github.com/BlueMap-Minecraft/BlueMap.git
synced 2024-11-22 18:45:21 +01:00
Fix an exception when trying to access ungenerated chunks in an area that has no region file
This commit is contained in:
parent
76ea6e1918
commit
7d9b4d3f4b
@ -223,7 +223,7 @@ private boolean loadResources() throws IOException, ParseResourceException {
|
||||
File resourcePackFolder = configFolder.toPath().resolve("resourcepacks").toFile();
|
||||
resourcePackFolder.mkdirs();
|
||||
File[] resourcePacks = resourcePackFolder.listFiles();
|
||||
Arrays.sort(resourcePacks);
|
||||
Arrays.sort(resourcePacks); //load resource packs in alphabetical order so you can reorder them by renaming
|
||||
|
||||
List<File> resources = new ArrayList<>(resourcePacks.length + 1);
|
||||
resources.add(defaultResourceFile);
|
||||
|
@ -28,6 +28,7 @@
|
||||
import java.io.DataInputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.io.RandomAccessFile;
|
||||
import java.nio.file.Path;
|
||||
@ -225,6 +226,8 @@ private Chunk loadChunk(Vector2i chunkPos) throws IOException {
|
||||
throw new IOException("invalid data tag: " + (tag == null ? "null" : tag.getClass().getName()));
|
||||
}
|
||||
|
||||
} catch (FileNotFoundException ex) {
|
||||
return Chunk.empty(this, chunkPos);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -166,7 +166,7 @@ public synchronized void load() throws ExecutionException, IOException, Interrup
|
||||
File resourcePackFolder = getConfigPath().resolve("resourcepacks").toFile();
|
||||
resourcePackFolder.mkdirs();
|
||||
File[] resourcePacks = resourcePackFolder.listFiles();
|
||||
Arrays.sort(resourcePacks);
|
||||
Arrays.sort(resourcePacks); //load resource packs in alphabetical order so you can reorder them by renaming
|
||||
|
||||
List<File> resources = new ArrayList<>(resourcePacks.length + 1);
|
||||
resources.add(defaultResourceFile);
|
||||
|
Loading…
Reference in New Issue
Block a user