DataInputStream in = region.getChunkDataInputStream(regionX, regionZ);
Chunk chunk = new Chunk(x, z);
NBTInputStream nbt = new NBTInputStream(in, false);
CompoundTag tag = (CompoundTag) nbt.readTag();
Map<String, Tag> levelTags = ((CompoundTag) tag.getValue().get("Level")).getValue();
byte[] tileData = ((ByteArrayTag) levelTags.get("Blocks")).getValue();
chunk.setTypes(tileData);