diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/world/mca/MCAWorld.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/world/mca/MCAWorld.java index 42db41cf..d4a0eb72 100644 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/world/mca/MCAWorld.java +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/world/mca/MCAWorld.java @@ -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; + } + }