public ResourcePackInfos ReadResourcePackInfos() { int count = _reader.ReadInt16(); // LE var packInfos = new ResourcePackInfos(); for (int i = 0; i < count; i++) { var info = new ResourcePackInfo(); info.PackIdVersion = new PackIdVersion() { Id = ReadString(), Version = ReadString() }; info.Unknown = ReadUlong(); packInfos.Add(info); } return(packInfos); }
private void LoadMeta(ZipArchive archive) { ResourcePackInfo info; var entry = archive.GetEntry("pack.mcmeta"); if (entry == null) { info = new ResourcePackInfo(); } else { using (TextReader reader = new StreamReader(entry.Open())) { ResourcePackInfoWrapper wrap = MCJsonConvert.DeserializeObject <ResourcePackInfoWrapper>(reader.ReadToEnd()); info = wrap.pack; } } Info = info; }
private void LoadMeta(ZipArchive archive) { ResourcePackInfo info; var entry = archive.GetEntry("pack.mcmeta"); if (entry == null) { info = new ResourcePackInfo(); } else { using (var stream = entry.Open()) { ResourcePackInfoWrapper wrap = MCJsonConvert.DeserializeObject <ResourcePackInfoWrapper>( Encoding.UTF8.GetString(stream.ReadToSpan(entry.Length))); info = wrap.pack; } } Info = info; }