Beispiel #1
0
        protected override void Initiate(out LevelInfo info)
        {
            info = _generator.GetInfo();

            /*lock (genLock)
             * {
             *      while (_preGeneratedChunks.TryDequeue(out ChunkColumn chunk))
             *      {
             *              if (chunk != null)
             *              {
             *                      base.LoadChunk(chunk, chunk.X, chunk.Z, false);
             *                      LoadEntities(chunk);
             *              }
             *      }
             *
             *      _preGeneratedChunks = null;
             * }*/

            UpdateThread = new Thread(RunThread)
            {
                IsBackground = true
            };

            UpdateThread.Start();

            if (base.World is World world)
            {
                World = world;

                world.Player.CanFly   = true;
                world.Player.IsFlying = true;
                //world.Player.Controller.IsFreeCam = true;
            }

            base.World?.UpdatePlayerPosition(new PlayerLocation(GetSpawnPoint()));

            Log.Info($"World {info.LevelName} loaded!");
        }