/// <summary> /// Loads the idCounts Map from the 'idcounts' file. /// </summary> private void LoadIdCounts() { try { IdCounts.Clear(); if (SaveHandler == null) { return; } string file = SaveHandler.GetMapFileFromName("idcounts"); if (file != null && File.Exists(file)) { BinaryReader datainputstream = new BinaryReader(new FileStream(file, FileMode.Open)); NBTTagCompound nbttagcompound = CompressedStreamTools.Read(datainputstream); datainputstream.Close(); IEnumerator <NBTBase> iterator = nbttagcompound.GetTags().GetEnumerator(); do { if (!iterator.MoveNext()) { break; } NBTBase nbtbase = iterator.Current; if (nbtbase is NBTTagShort) { NBTTagShort nbttagshort = (NBTTagShort)nbtbase; string s = nbttagshort.GetName(); short word0 = nbttagshort.Data; IdCounts[s] = word0; } }while (true); } } catch (Exception exception) { Utilities.LogException(exception); } }