mirror of
https://github.com/BlueMap-Minecraft/BlueMap.git
synced 2024-11-22 18:45:21 +01:00
Also search in parent folder for a level.dat
This commit is contained in:
parent
611109ea91
commit
ee384322d7
@ -357,7 +357,15 @@ private Path getMCAFilePath(Vector2i region) {
|
||||
|
||||
public static MCAWorld load(Path worldFolder, UUID uuid, BlockIdMapper blockIdMapper, BlockPropertiesMapper blockPropertiesMapper, BiomeMapper biomeIdMapper) throws IOException {
|
||||
try {
|
||||
CompoundTag level = (CompoundTag) NBTUtil.readTag(worldFolder.resolve("level.dat").toFile());
|
||||
File levelFile = new File(worldFolder.toFile(), "level.dat");
|
||||
if (!levelFile.exists()) {
|
||||
levelFile = new File(worldFolder.toFile().getParentFile(), "level.dat");
|
||||
}
|
||||
if (!levelFile.exists()) {
|
||||
throw new FileNotFoundException("Could not find a level.dat file for this world!");
|
||||
}
|
||||
|
||||
CompoundTag level = (CompoundTag) NBTUtil.readTag(levelFile);
|
||||
CompoundTag levelData = level.getCompoundTag("Data");
|
||||
|
||||
String name = levelData.getString("LevelName");
|
||||
|
Loading…
Reference in New Issue
Block a user