public static TagCompound Save(Dimension dimension)
        {
            var tag = new TagCompound();

            tag.Set("saveversion", Dimension.saveversion);
            tag.Set("index", dimension.index);
            tag.Set("modname", dimension.modname);
            tag.Set("areaname", dimension.areaname);
            tag.Set("area", dimension.area);
            AlternateDimensionsWorld.DebugText($"Writing out {dimension}");
            return(tag);
        }
        public static Dimension Load(TagCompound tag)
        {
            int       saveversion = tag.GetInt("saveversion");
            int       index       = tag.GetInt("index");
            string    modname     = tag.GetString("modname");
            string    areaname    = tag.GetString("areaname");
            Rectangle area        = tag.Get <Rectangle>("area");
            Dimension result      = new Dimension(index, modname, areaname, area);

            AlternateDimensionsWorld.DebugText("Loaded " + result);
            return(result);
        }
예제 #3
0
        public override void Load()
        {
            // 0.10.2 needed for Rectangle TagSerializer
            //if (ModLoader.version < new Version(0, 10, 2))
            //{
            //	throw new Exception("\nThis mod uses functionality only present in the latest tModLoader. Please update tModLoader to use this mod\n\n");
            //}

            SwapWorldsHotkey = RegisterHotKey("Swap Worlds", "O");
            modInstance      = this;
            worldInstance    = (AlternateDimensionsWorld)GetModWorld("AlternateDimensionsWorld");
            worldInstance.Load();
        }