protected override void Initiate(out LevelInfo info, out IChatProvider chatProvider) { info = new LevelInfo(); chatProvider = Client; _initiated = true; Client.WorldReceiver = WorldReceiver; WorldReceiver?.UpdatePlayerPosition(new API.Utils.PlayerLocation( new Vector3(Client.CurrentLocation.X, Client.CurrentLocation.Y, Client.CurrentLocation.Z), Client.CurrentLocation.HeadYaw, Client.CurrentLocation.Yaw, Client.CurrentLocation.Pitch)); _gameTickTimer = new System.Threading.Timer(GameTick, null, 50, 50); }
protected override void Initiate(out LevelInfo info, out IChatProvider chatProvider) { info = _generator.GetInfo(); chatProvider = null; /*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 (WorldReceiver is World world) { world.Player.CanFly = true; world.Player.IsFlying = true; world.Player.Controller.IsFreeCam = true; } WorldReceiver?.UpdatePlayerPosition(new PlayerLocation(GetSpawnPoint())); Log.Info($"World {info.LevelName} loaded!"); }