using System; using System.Collections.Generic; using System.Linq; using System.Runtime; using System.Text; using System.Threading.Tasks; using LibAC.NBT; using LibAC.NBT.API; namespace LibAC { public class VersionNumberDifferentException : Exception { public VersionNumberDifferentException(Version one, Version two) : base($"The version numbers are not identical. Current version {one} ; Other {two}") { } } public class Version { public List ver { get; set; } = new List(); public Version() { } public Version(int major, int minor, int revision, int build, int cycleStatus, int cycleNum) { ver = new List(); ver.Add(major); ver.Add(minor); ver.Add(revision); ver.Add(build); ver.Add(cycleStatus); ver.Add(cycleNum); } public int Compare(Version other) { for(int i=0;i oth) return 2; } return 0; } public Version(string versionStr) { ver = new List(); List split = versionStr.llParseStringKeepNulls(new string[] { "." }, new string[] { "R", "A", "B", "RC", "DEV" }); for(int i=0;i(); foreach(Tag tag in lt.GetList) { IntTag it = tag as IntTag; ver.Add(it.Value); } } public CompoundTag save() { CompoundTag ct = new CompoundTag(); ListTag lt = new ListTag(); foreach(int v in ver) { IntTag i = IntTag.ValueOf(v); lt.Add(i); } ct.Put("Version", lt); return ct; } } }