public override bool Equals(object par1Obj) { if (base.Equals(par1Obj)) { NBTTagShort nbttagshort = (NBTTagShort)par1Obj; return(Data == nbttagshort.Data); } else { return(false); } }
/// <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); } }
/// <summary> /// Stores a new NBTTagShort with the given short value into the map with the given string key. /// </summary> public virtual void SetShort(string par1Str, short par2) { TagMap[par1Str] = new NBTTagShort(par1Str, par2); }