Example #1
0
        /// <summary>
        /// Empty level with null/default values that need to be assigned after initialized
        /// </summary>
        /// <param name="size">Base size of map (can be changed)</param>
        public Level(Vector3S size)
        {
            CWMap = new ClassicWorld(size.x, size.z, size.y)
            {
                SpawnPos = new Vector3S((short)(size.x / 2),
                                        (short)(size.y / 2),
                                        (short)(size.z / 2)),
                SpawnRotation = new Vector2S(128, 128),
                BlockData     = new byte[size.x * size.y * size.z]
            };

            Settings          = new Metadata(); // -- Hypercube specific settings, woo.
            Settings.perbuild = 0;              // -- Enable building, history and physics by default.
            Settings.pervisit = 0;



            CWMap.MetadataParsers.Add("MCForge", Settings); // -- Add the parser so it will save with the map :)


            CWMap.GeneratingSoftware = "MCForge";
            CWMap.GeneratorName      = "Blank";
            CWMap.CreatingService    = "Classicube";
            CWMap.CreatingUsername   = "******";

            var myRef = (CPEMetadata)CWMap.MetadataParsers["CPE"];

            if (myRef.CustomBlocksFallback == null)
            {
                myRef.CustomBlocksLevel    = 1;
                myRef.CustomBlocksVersion  = 1;
                myRef.CustomBlocksFallback = new byte[256];



                CWMap.MetadataParsers["CPE"] = myRef;
            }
            //         a = new byte[CWMap.Size.x, CWMap.Size.z, CWMap.Size.y];
            BackupLevel = true;
            ExtraData   = new ExtraData <object, object>();
        }
Example #2
0
        /// <summary>
        /// Empty level with null/default values that need to be assigned after initialized
        /// </summary>
        /// <param name="size">Base size of map (can be changed)</param>
        public Level(Vector3S size)
        {
            CWMap = new ClassicWorld(size.x, size.z, size.y)
            {
                SpawnPos = new Vector3S((short)(size.x / 2),
                (short)(size.y / 2),
                (short)(size.z / 2)),
                SpawnRotation = new Vector2S(128, 128),
                BlockData = new byte[size.x * size.y * size.z]
            };

            Settings = new Metadata(); // -- Hypercube specific settings, woo.
            Settings.perbuild = 0; // -- Enable building, history and physics by default.
            Settings.pervisit = 0;

            CWMap.MetadataParsers.Add("MCForge", Settings); // -- Add the parser so it will save with the map :)

            CWMap.GeneratingSoftware = "MCForge";
            CWMap.GeneratorName = "Blank";
            CWMap.CreatingService = "Classicube";
            CWMap.CreatingUsername = "******";

            var myRef = (CPEMetadata)CWMap.MetadataParsers["CPE"];

            if (myRef.CustomBlocksFallback == null)
            {
                myRef.CustomBlocksLevel = 1;
                myRef.CustomBlocksVersion = 1;
                myRef.CustomBlocksFallback = new byte[256];

                CWMap.MetadataParsers["CPE"] = myRef;
            }
               //         a = new byte[CWMap.Size.x, CWMap.Size.z, CWMap.Size.y];
            BackupLevel = true;
            ExtraData = new ExtraData<object, object>();
        }