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 @@ public class BlueMapCLI {
|
|||
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.BufferedInputStream;
|
|||
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 @@ public class MCAWorld implements World {
|
|||
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 class SpongePlugin {
|
|||
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