mirror of
https://github.com/BlueMap-Minecraft/BlueMap.git
synced 2025-01-10 02:07:45 +01:00
Improve readabillity
This commit is contained in:
parent
2029fe0a87
commit
b330c5d168
@ -269,8 +269,7 @@ public static MCAWorld load(Path worldFolder, Key dimension, DataPack dataPack)
|
||||
|
||||
// load level.dat
|
||||
Path levelFile = worldFolder.resolve("level.dat");
|
||||
BlueNBT blueNBT = MCAUtil.addCommonNbtAdapters(new BlueNBT());
|
||||
blueNBT.register(TypeToken.get(DimensionType.class), new DimensionTypeDeserializer(blueNBT, dataPack));
|
||||
BlueNBT blueNBT = createBlueNBTForDataPack(dataPack);
|
||||
LevelData levelData;
|
||||
try (InputStream levelFileIn = Compression.GZIP.decompress(Files.newInputStream(levelFile))) {
|
||||
levelData = blueNBT.read(levelFileIn, LevelData.class);
|
||||
@ -297,4 +296,10 @@ public static Path resolveDimensionFolder(Path worldFolder, Key dimension) {
|
||||
return worldFolder.resolve("dimensions").resolve(dimension.getNamespace()).resolve(dimension.getValue());
|
||||
}
|
||||
|
||||
private static BlueNBT createBlueNBTForDataPack(DataPack dataPack) {
|
||||
BlueNBT blueNBT = MCAUtil.addCommonNbtAdapters(new BlueNBT());
|
||||
blueNBT.register(TypeToken.get(DimensionType.class), new DimensionTypeDeserializer(blueNBT, dataPack));
|
||||
return blueNBT;
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user