Revert "Fix loading some chunk formats in 1.12. Fixes #33"

This reverts commit 1ddc229047.
This commit is contained in:
Blue (Lukas Rieger) 2020-04-06 14:18:40 +02:00
parent d172d0f27d
commit 24c50c27c6
1 changed files with 3 additions and 17 deletions

View File

@ -31,11 +31,8 @@ import de.bluecolored.bluemap.core.mca.mapping.BlockIdMapper;
import de.bluecolored.bluemap.core.world.Biome;
import de.bluecolored.bluemap.core.world.BlockState;
import de.bluecolored.bluemap.core.world.LightData;
import net.querz.nbt.ByteArrayTag;
import net.querz.nbt.CompoundTag;
import net.querz.nbt.IntArrayTag;
import net.querz.nbt.ListTag;
import net.querz.nbt.Tag;
import net.querz.nbt.mca.MCAUtil;
public class ChunkAnvil112 extends Chunk {
@ -44,7 +41,7 @@ public class ChunkAnvil112 extends Chunk {
private boolean isGenerated;
private Section[] sections;
private int[] biomes;
private byte[] biomes;
@SuppressWarnings("unchecked")
public ChunkAnvil112(MCAWorld world, CompoundTag chunkTag) {
@ -65,21 +62,10 @@ public class ChunkAnvil112 extends Chunk {
sections[section.getSectionY()] = section;
}
Tag<?> tag = levelData.get("Biomes"); //tag can be byte-array or int-array
if (tag instanceof ByteArrayTag) {
byte[] bs = ((ByteArrayTag) tag).getValue();
biomes = new int[bs.length];
for (int i = 0; i < bs.length; i++) {
biomes[i] = bs[i] & 0xFF;
}
}
else if (tag instanceof IntArrayTag) {
biomes = ((IntArrayTag) tag).getValue();
}
biomes = levelData.getByteArray("Biomes");
if (biomes == null || biomes.length == 0) {
biomes = new int[2048];
biomes = new byte[2048];
}
}