Allow reading chunk-sections that have an integer y tag instead of a byte

This commit is contained in:
Blue (Lukas Rieger) 2020-10-05 17:09:28 +02:00
parent 9a22424241
commit e071ed83fa
No known key found for this signature in database
GPG Key ID: 904C4995F9E1F800
4 changed files with 8 additions and 22 deletions

View File

@ -35,6 +35,7 @@
import de.bluecolored.bluemap.core.world.LightData;
import net.querz.nbt.CompoundTag;
import net.querz.nbt.ListTag;
import net.querz.nbt.NumberTag;
import net.querz.nbt.mca.MCAUtil;
public class ChunkAnvil112 extends Chunk {
@ -134,7 +135,7 @@ private class Section {
private byte[] data;
public Section(CompoundTag sectionData) {
this.sectionY = sectionData.getByte("Y");
this.sectionY = sectionData.get("Y", NumberTag.class).asInt();
this.blocks = sectionData.getByteArray("Blocks");
this.add = sectionData.getByteArray("Add");
this.blockLight = sectionData.getByteArray("BlockLight");

View File

@ -36,12 +36,7 @@
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.StringTag;
import net.querz.nbt.Tag;
import net.querz.nbt.*;
import net.querz.nbt.mca.MCAUtil;
public class ChunkAnvil113 extends Chunk {
@ -147,7 +142,7 @@ private class Section {
@SuppressWarnings("unchecked")
public Section(CompoundTag sectionData) {
this.sectionY = sectionData.getByte("Y");
this.sectionY = sectionData.get("Y", NumberTag.class).asInt();
this.blockLight = sectionData.getByteArray("BlockLight");
this.skyLight = sectionData.getByteArray("SkyLight");
this.blocks = sectionData.getLongArray("BlockStates");

View File

@ -36,12 +36,7 @@
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.StringTag;
import net.querz.nbt.Tag;
import net.querz.nbt.*;
import net.querz.nbt.mca.MCAUtil;
public class ChunkAnvil115 extends Chunk {
@ -148,7 +143,7 @@ private class Section {
@SuppressWarnings("unchecked")
public Section(CompoundTag sectionData) {
this.sectionY = sectionData.getByte("Y");
this.sectionY = sectionData.get("Y", NumberTag.class).asInt();
this.blockLight = sectionData.getByteArray("BlockLight");
this.skyLight = sectionData.getByteArray("SkyLight");
this.blocks = sectionData.getLongArray("BlockStates");

View File

@ -36,12 +36,7 @@
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.StringTag;
import net.querz.nbt.Tag;
import net.querz.nbt.*;
import net.querz.nbt.mca.MCAUtil;
public class ChunkAnvil116 extends Chunk {
@ -148,7 +143,7 @@ private class Section {
@SuppressWarnings("unchecked")
public Section(CompoundTag sectionData) {
this.sectionY = sectionData.getByte("Y");
this.sectionY = sectionData.get("Y", NumberTag.class).asInt();
this.blockLight = sectionData.getByteArray("BlockLight");
this.skyLight = sectionData.getByteArray("SkyLight");
this.blocks = sectionData.getLongArray("BlockStates");