forked from mirror/BlueMap
Revert "Fix loading some chunk formats in 1.12. Fixes #33"
This reverts commit 1ddc229047
.
This commit is contained in:
parent
d172d0f27d
commit
24c50c27c6
@ -31,11 +31,8 @@
|
||||
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 ChunkAnvil112(MCAWorld world, CompoundTag chunkTag) {
|
||||
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];
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user